<?php
define('DS',DIRECTORY_SEPARATOR);

include("utils.php");

if($_SESSION['siteuserId']==""){
	header("location:index.php");
}
//set reference
$activeStep = &$_SESSION["SELL_WEBSITE_ADD.ACTIVESTEP"];
$data = &$_SESSION["SELL_WEBSITE_ADD.DATA"];
if(!is_numeric($activeStep)&&$activeStep<=0)
	$activeStep=1;
// proccess data 
switch(strtolower($_POST['submit'])."$activeStep")
{
	case "next1":
		//validating server side
		$siteName = strip_tags($_POST['site_name']);
		$siteUrl = strip_tags($_POST['destinationUrl']);
		$category = strip_tags($_POST['adcategory']);
		$description = strip_tags($_POST['description']);
		//validate flag
		$validate =true;
		$msg = array();
		if(empty($siteName))
		{
			$validate=false;
			$msg[]="Site Name is missing";
		}
		if(empty($siteUrl))
		{
			$validate=false;
			$msg[]="Site URL is missing";
		}
		if(empty($category))
		{
			$validate=false;
			$msg[]="Category is missing";
		}
		if(empty($description))
		{
			$validate=false;
			$msg[]="Description is missing";
		}
		if(!$validate)
		{
			// throw error
			echo "<script>alert('".implode('\n',$msg)."');</script>";
		}
		else
		{
			//saving data and move to next step
			$adWeb = new stdClass();
			$adWeb->site_id=$_POST['site_id'];
			$adWeb->name=$siteName;
			$adWeb->url= $siteUrl;
			$adWeb->category = $category;
			$adWeb->description= $description;
			$adWeb->type='WEB';// default is website
			$data=$adWeb;
			$activeStep=2;
		}
		break;
	case "next2":
		$adSpace = new stdClass();
		$adSpace->space_type=strtolower($_POST['adspace_type']);
		$adSpace->name= $_POST['adname'];
		$adSpace->description = $_POST['addesc'];
		$adSpace->begin_date = $_POST['begin_date'];
		
		switch(strtolower($_POST['adspace_type']))
		{
			case "text":
				
				if($_POST['text_ad_Type']=='network')
				{
					$adSpace->ad_type='Y';
				}
				else
				{
					$adSpace->ad_type="N";
				}				
				$adSpace->cell_count = $_POST['cell_count'];
				$adSpace->alignment = $_POST['text_alignment'];
				$adSpace->size = $_POST['size'];
				$adSpace->font_type= $_POST['font_type'];
				$adSpace->background_color = $_POST['text_background_color'];
				$adSpace->headline_color= $_POST['title_color'];
				$adSpace->description_color= $_POST['description_color'];
				$adSpace->hide_broker_link= $_POST['broker_link_hide'];				
				break;
			case "banner":
				if($_POST['banner_ad_Type']=='network')
				{
					$adSpace->ad_type='Y';
				}
				else
				{
					$adSpace->ad_type="N";
				}
				$adSpace->size = $_POST['banner_size'];
				$adSpace->template_setting = $_POST['template_setting'];
				$adSpace->background_color = $_POST['banner_background_color'];
				$adSpace->header_font_type = $_POST['header_font_type'];
				$adSpace->header_background_color = $_POST['header_bg_color'];				
				$adSpace->body_font_type= $_POST['body_font_type'];
				$adSpace->body_background_color = $_POST['body_bg_color'];
				$adSpace->banner= $_FILES['banner'];
				break;
			case "thumbnail":
				$adSpace->thumbCompHandle = isset($_POST['handle'])? "Y":"N";
				$adSpace->thumbCompAge = isset($_POST['age'])?"Y":"N";
				$adSpace->thumbComplOCATION = isset($_POST['location']) ?"Y":"N";
				$adSpace->thumbCompHeadline = isset($_POST['headline']) ?"Y":"N";
				$adSpace->thumbCompImage = isset($_POST['image'])?"Y":"N";
				$adSpace->allowNetwork = isset($_POST['allow_network'])?"Y":"N";
				$adSpace->thumbSize = $_POST['thumb_size'];
				$adSpace->thumbCustomSize = isset($_POST['custom_gtb_size'])?"Y":"N";
				$adSpace->thumbCustomWidth =$_POST['width'];
				$adSpace->thumbCustomHeight = $_POST['height'];				
				$adSpace->thumbView = $_POST['thumb_count'];								
				
				$adSpace->backgroundColor = $_POST['thumb_background_color'];
				$adSpace->thumbOrientation = $_POST['thumbnail_alignment'];
				
				$adSpace->thumbnail= $_FILES['thumbnail'];
				$adSpace->thHeaderFontSize=$_POST['title_font_size'];
				$adSpace->thHeaderFontType=$_POST['title_font_type'];
				$adSpace->thHeaderFontColor=$_POST['title_font_color'];
				$adSpace->thHeaderAttriBold=$_POST['title_bold'];
				$adSpace->thHeaderAttriUnderline=$_POST['title_underline'];
				$adSpace->thHeaderAttriItalic=$_POST['title_italic'];
				$adSpace->thHeaderAlign=$_POST['title_align'];
				$adSpace->thumbBodyFontSize=$_POST['description_font_size'];				
				$adSpace->thumbBodyFontType=$_POST['description_font_type'];
				$adSpace->thumbBodyFontColor=$_POST['description_font_color'];
				$adSpace->thumbBodyAttriBold=$_POST['description_bold'];
				$adSpace->thumbBodyAttriUnderline=$_POST['description_underline'];
				$adSpace->thumbBodyAttriItalic=$_POST['description_italic'];
				$adSpace->thumbBodyAlign=$_POST['description_align'];
				
				
				break;
			case "customize_commbreak":
				$adSpace->commercialHeight=$_POST['customize_height'];
				$adSpace->backgroundColor=$_POST['customize_background_color'];								
				$adSpace->fontSize=$_POST['font_size'];
				$adSpace->fontType=$_POST['customize_font_type'];
				$adSpace->color=$_POST['font_color'];
				$adSpace->commercialAttrBold=$_POST['font_bold'];
				$adSpace->commercialAttrUnderline=$_POST['font_underline'];
				$adSpace->commercialAttrItalic=$_POST['font_italic'];				
				
				break;
		}
		$data->adSpace= $adSpace;
			$activeStep=3;
		break;
	case 'next3':
			$adsBid = new stdClass();
			$validate =true;
			$msg = array();
			if(empty($_REQUEST['bid']))
			{
				$validate=false;
				$msg[]="Please specify a bid for this ad.";
			}else if($_REQUEST['bid']<0.01){
				$validate=false;
				$msg[]="You must set a minimum bid of $0.01 for this ad.";
			}
			if(!$validate)
			{
				// throw error
				echo "<script>alert('".implode('\n',$msg)."');</script>";
			}
			else
			{
				$adsBid->amount= $_POST['bid'];
				$data->adsBid = $adsBid;
				//check payment method. if no payment method was prefered then u must move to step3 else move to step4
				$query ="SELECT COUNT(*) FROM payment_method WHERE
						userId='".$_SESSION['siteuserId']."'
						AND userType='P'
						AND prefered_status='Y'";
				 $result = mysql_query($query);
				 $row = mysql_fetch_array($result);
				if($row[0]>0)		 
					$activeStep=5;//move to step4 if payment method was exist
				 else
					$activeStep=4;// move to step3 to input payment method					
			}
				
		break;
	case "next4":
		//validate cc form 	
		$cc_type = $_POST['card-type'];
		$cc_number = $_POST['card-number'];
		$cc_exp_month = $_POST['card_exp_month'];
		$cc_exp_year = $_POST['card_exp_year'];
		$cc_cvn = $_POST['cvn'];
		$b_name = $_POST['billing-name'];
		$b_address = $_POST['billing-address'];
		$b_city = $_POST['billing-city'];
		$b_state = $_POST['billing-state'];
		$b_zip = $_POST['billing-zip'];
		$b_country = $_POST['billing-country'];
		$msg=array();		
		if(empty($cc_type))	
			$msg[]="Card type is missing";
		
		if(empty($cc_number))	
			$msg[]="Card Number is missing";
		elseif(!is_numeric($cc_number))
			$msg[]="Card Number must be numeric";
		if(empty($cc_cvn))	
			$msg[]="CVN is missing";
		elseif(!is_numeric($cc_cvn))
			$msg[]="CVN must be numeric";
		if(empty($b_name))	
			$msg[]="Name  is missing";
		if(empty($b_address))	
			$msg[]="Address is missing";
		if(empty($b_city))	
			$msg[]="City is missing";
		/// check country and state 
		$country_code=$b_country;
		$query = "SELECT * FROM country WHERE countries_iso_code_2='".$b_country."'";
		$result = mysql_query($query);
		if($selectedCountry = mysql_fetch_array($result))
			$b_country=$selectedCountry['countries_iso_code_2'];
		else
			$msg[]="Country is missing";
		
		if(strtoupper($country_code)=='CA'||strtoupper($country_code)=='US')
		{
			//check state
			if(empty($b_state))	
				$msg[]="State is missing";
			else
			{
				$query = "SELECT s.*  FROM `state` s 
                                            INNER JOIN (select countryid from `country` where countries_iso_code_2 IN ('US','CA')) c 
                                            ON s.country_code=c.countryId 
                                            WHERE is_active='Y' and (state_name='$b_state' OR state_code='$b_state')";
                                $result = mysql_query($query);
				if($row_state = mysql_fetch_array($result))
					$b_state=$row_state['state_code'];
				else
					$msg[]="State is invalid";
			}
		}
		else
		{
			$b_state=0;
		}
		
		// saving all 
		if(count($msg)==0)
		{				
			//-- saving payment
			$query = "
					INSERT INTO payment_method(
					userId,
					userType,
					payment_method,
					payment_name,
					creadit_card_no,
					creadit_card_name,
					expire_date,
					security_code,			
					billing_address1,
					city,
					country,
					state,
					zip,
					prefered_status
					)
					VALUES(
					'".$_SESSION['siteuserId']."',
					'P',
					'".$cc_type."',
					'".$cc_type."',
					'".$cc_number."',
					'".$b_name."',
					'".$cc_exp_year.'-'.$cc_exp_month.'-00'."',
					'".$cc_cvn."',
					'".$b_address."',
					'".$b_city."',
					'".$b_country."',
					'".$b_state."',
					'".$b_zip."',
					'Y'
					)
					
					";
			mysql_query($query);
			if(mysql_errno()>0)
				echo "SQL Error payment_method: ".mysql_error();			
			//move to step4
			$activeStep=5;
		
			
		}
		elseif(count($msg)>0)
		{
			echo "<script>alert('".implode('\n',$msg)."');</script>";
		}
		
		break;
	case "next5":
		break;
	default:
		break;
}
if(strtolower($_POST['submit'])=="cancel")
{
	// clear all template data and start at begining step
	$data=null;
	$activeStep=1;
	
}
if(isset($_POST['back']))
{
	// back to early step
	if($activeStep>1)
	{
		$activeStep--;
		//
	}
	else	
		$activeStep=1;
	
	
}


//main entry
main_content("step$activeStep();");

/**
 * render step infomation 
 * total 4 step with an active step
 *
 * @return mixed html 
 *
 */
function stepInfo($activeStep=null)
{	
	if(is_null($activeStep))
		$activeStep=$_SESSION["SELL_WEBSITE_ADD.ACTIVESTEP"];
	if(!is_numeric($activeStep)&&$activeStep<=0)
		$activeStep=1;
	$arrStep = array();
	$arrStep[1]="Describe Your Site";
	$arrStep[2]="Ad Specs";
	$arrStep[3]="Creative & Bid";
	$arrStep[4]="Payment Info";
	$arrStep[5]="Get Code";
	//$arrStep[4]="Creative & Bid";
	
	
	?>	
	<div style="text-align:center">
	<?php for($i=1;$i<=count($arrStep);$i++):?>
		<label style="font-weight:<?php echo $i==$activeStep ? "bold":"normal";?>"><?php echo "Step $i - " . $arrStep[$i];?></label>
		<?php if($i<count($arrStep)):?>
			|
			<?php endif;?>		
		<?php endfor;?>
	<br/><br/><br/>
	</div>
	<?php
	
}
function step1()
{
	global $data;
	
	if(isset($_POST['import-submit'])&&isset($_POST['import']))
	{
		$query ="select * from adsite_master where adsiteId='".strip_tags($_POST['site_id'])."' AND siteuserId='".$_SESSION['siteuserId']."' and status='Y'";
		$rsSiteUrl = mysql_query($query);
		if($site= mysql_fetch_array($rsSiteUrl))
		{
			//$_POST['site_id']=$data->id;
			$_POST['site_name']=$site['adSiteName'];
			$_POST['destinationUrl']=$site['adSiteUrl'];
			$_POST['adcategory']=$site['adcategoryId'];
			$_POST['description']=$site['siteDescription'];
		}
	}
	if(!is_null($data))
	{
		$_POST['site_id']=$data->site_id;
		$_POST['site_name']=$data->name;
		$_POST['destinationUrl']=$data->url;
		$_POST['adcategory']=$data->category;
		$_POST['description']=$data->description;
		$data=null;
	}
	$query ="select * from adsite_master where siteuserId='".$_SESSION['siteuserId']."' and status='Y'";
	$rsSiteUrl = mysql_query($query);
	
?>

<script type="text/javascript" src="JavaScripts/jquery.textarea.limit-1.2.source.js"></script>
<script>
	function onImport()
	{
		val=jQuery('select[name=site_id] option:selected').val();		
		if(val!='')
		{
			jQuery('#step1-import').val('1');			
			jQuery('#import-submit').click();
		}
		else
		{
			//clear form
			jQuery('input[name=site_name]').val('');
			jQuery('input[name=destinationUrl]').val('');
			jQuery('#adcategory option').attr('selected',false);
			jQuery('#description').val('');
		}
	}
</script>
	
<table width="98%" border="0" cellspacing="0" cellpadding="0">
   <tr>
      <td valign="top" align="center">
         <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
               <td width="20%" valign="top"><?php include("left_pannel.php"); ?></td>
               
               	<td style="width:10px;">&nbsp;</td>
                    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="11"><img src="images/PinkBorderTopLeft.jpg" alt="" width="11" height="11"></td>
                              <td class="PinkBoxTopBg"><img src="images/spacer.gif" alt="" width="10" height="11"></td>
                              <td width="11"><img src="images/PinkBorderTopRight.jpg" alt="" width="11" height="11"></td>
                            </tr>
                        </table></td>
                      </tr>
                      <tr>
                      
                        <td class="PinkTwosideBorder" valign="top">
                        	<table width="100%" class="center" cellspacing="0" cellpadding="0">
  								 <tr>
							    	<td align="left" valign="top">
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
							           	<tr>
							           <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
							               <tr>
											<td width="29"><img src="images/TitleArrowLeft.jpg" alt="" width="29" height="30"></td>
											<td class="MarketTitleBg"><?php echo REGISTER_TXT;?></td>
							                </tr>
							                </table>
									  </td>
							          </tr>
									<tr>
									<TD align="center">
									<br/><br/><br/>
									<?php stepInfo();?>
	<form name="frm_step1" id="frm_step1" method="POST" action="" >
	<input id='step1-import' type="hidden" name="import" value="0"/>
	<input id='import-submit' type="submit" name="import-submit" value="" style='display:none'
	/>
							<table width="400" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td width="100" height="30">
											<table width="100%" border="0" cellspacing="0" cellpadding="0">
												<tr>
													<td width="3"><img src="images/FormNameBoxLeft.jpg" alt="" width="3" height="18"></td>
													<td class="FormNameBoxBg">New/Import Site:</td>
													<td width="13"><img src="images/FormNameBoxRight.jpg" alt="" width="13" height="18"></td>
												</tr>
											</table>
										</td>
										<td width="14">&nbsp;</td>
										<td>
											<select name='site_id' onchange="onImport(); ">
												<option value="">New</option
												<optgroup label="Existing Websites">											
												<?while($row=mysql_fetch_array($rsSiteUrl)):?>
													<option value="<?php echo $row['adsiteId'];?>" <?php echo ($_POST['site_id']==$row['adsiteId']?"selected":'');?>><?php echo $row['adSiteName'];?></option>
												<?php endwhile;?>
												</optgroup>
											</select>
										</td>
										<td width="11">&nbsp;</td>
										<td>&nbsp;</td>
									</tr>
                                  <tr>
                                    <td width="100" height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr>
                                            <td width="3"><img src="images/FormNameBoxLeft.jpg" alt="" width="3" height="18"></td>
                                        <td class="FormNameBoxBg"><?php echo SITENAME;?>:</td>
                                        <td width="13"><img src="images/FormNameBoxRight.jpg" alt="" width="13" height="18"></td>
                                      </tr>
                                    </table></td>
                                    <td width="14">&nbsp;</td>
                                    <td><input name="site_name" type="text" class="InputBox" id="siteName" value="<?php echo $_POST['site_name'];?>"></td>
                                    <td width="11">&nbsp;</td>
                                    <td>&nbsp;</td>
                                  </tr>
                                  <tr>
                                    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr>
                                        <td width="3"><img src="images/FormNameBoxLeft.jpg" alt="" width="3" height="18"></td>
                                        <td class="FormNameBoxBg"><?php echo SITEURL; ?></td>
                                        <td width="13"><img src="images/FormNameBoxRight.jpg" alt="" width="13" height="18"></td>
                                      </tr>
                                    </table></td>
                                    <td>&nbsp;</td>
                                    <td>
									
									<input name="destinationUrl" id="destinationUrl"  type="text" class="InputBox" value="<?php echo $_POST['destinationUrl'];?>">
									
									</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                  </tr>
                                  <tr>
                                    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr>
                                        <td width="3"><img src="images/FormNameBoxLeft.jpg" alt="" width="3" height="18"></td>
                                        <td class="FormNameBoxBg"><?php echo SITECATEGORY; ?></td>
                                        <td width="13"><img src="images/FormNameBoxRight.jpg" alt="" width="13" height="18"></td>
                                      </tr>
                                    </table></td>
                                    <td>&nbsp;</td>
                                    <td>
									<select id="adcategory" name="adcategory" class="InputBox">
									<option value="">--select--</option>
									<?
										$query_category=mysql_query("select * from ".CATEGORIES." where langId='1'");
										while($res_cat= mysql_fetch_array($query_category)){
											?>
		
                      				<option value="<?=$res_cat['adcategoryId']?>" <?php echo ($_POST['adcategory']==$res_cat['adcategoryId']?"selected":"");?>> <?=stripslashes($res_cat['categoryName']);?></option>
									<?
										}
										?>
									
									</select>

									</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                  </tr>
                                  <tr>
                                    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr>
                                        <td width="3"><img src="images/FormNameBoxLeft.jpg" alt="" width="3" height="18"></td>
                                        <td class="FormNameBoxBg" nowrap="true"><?php echo SITEDESC; ?></td>
                                        <td width="13"><img src="images/FormNameBoxRight.jpg" alt="" width="13" height="18"></td>
                                      </tr>
                                    </table></td>
                                    <td>&nbsp;</td>
                                    <td valign="middle" class="font-12 black advertise_tableTxt">

									<textarea id="description" name="description" cols="42" rows="5" class="InputtextArea" >
									<?php echo $_POST['description'];?>
									</textarea>	
									
									&nbsp;<font class="BlackContent">(<?php echo CHARACTER_LEFT; ?>:</font><span id="descriptionCount" class="BlackContent">255</span><font class="BlackContent"> )</font>			
									</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                  </tr>

                                  <tr>                                  
                                    <td height="30">&nbsp;</td>
                                    <td align="center">&nbsp;</td>
									<td align="left" valign="bottom">
										<input name="submit" type="submit" class="SubmitInputButton" id="button3" value="Next" onclick="return validateStep1();">
										&nbsp;
										<input type="submit" name="submit" value="Cancel"/>
										</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                  </tr>
                                  
                                </table></td>
                              </tr>
                            </table>

		</TD></tr>
		
		</table>

    </td>
  </tr>
	<tr>
		<td>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td width="11"><img src="images/PinkBorderBottomLeft.jpg" alt="" width="11" height="11"></td>
					<td class="PinkBoxBottomBg"><img src="images/spacer.gif" alt="" width="10" height="11"></td>
					<td width="11"><img src="images/PinkBorderBottomRight.jpg" alt="" width="11" height="11"></td>
				</tr>
			</table>
		</td>
	</tr>
	</table></td>
	<td >&nbsp;</td>
	</tr>
</table></td>
                      </tr>
                      
                </table></td>
              </tr>
            </table>
           
</form>
<script language="javascript">
function validateStep1()
{
	var validate =true;
	var msg='';
	val =jQuery.trim(jQuery('#siteName').val());
	if(val=='')
	{
		validate =false;
		msg+="Site Name is missing\n";
	}
	val =jQuery.trim(jQuery('#destinationUrl').val());
	if(val=='')
	{
		validate =false;
		msg+="Site URL is missing\n";
	}
	val =jQuery.trim(jQuery('#adcategory').val());
	if(val=='')
	{
		validate =false;
		msg+="Category is missing\n";
	}
	val =jQuery.trim(jQuery('#description').val());
	if(val=='')
	{
		validate =false;
		msg+="Description is missing\n";
	}
	if(!validate)	//alert error message if not vaild
		alert(msg);			
	return validate;
	
}
jQuery('document').ready(function(){
	//limit chars in discription
	jQuery('#description').limit(255,'#descriptionCount');
});
</script>
<?php
}
function step2()
{
	?>

<script type="text/javascript" src="JavaScripts/common.js"></script>
 <script type="text/javascript" language="javascript" src="JavaScripts/popup-layer.js"></script>
  <script type="text/javascript" language="javascript" src="JavaScripts/category-list.js"></script>
  <script type="text/javascript" language="javascript" src="JavaScripts/cover.js"></script>
	
	<script type="text/javascript" type="text/javascript" src="Javascripts/datetimepicker.js"></script>


<div id="colorlayer" onmouseover="javascript:enterColorPalette()" onmouseout="javascript:leaveColorPalette()"
    class="drag" style="visibility: hidden; width: 204px; height: 142px; position: absolute;
    z-index: 4; left: 488px; top: 635px;">
    <table bgcolor="#ffffff" border="0" cellpadding="1" cellspacing="2" width="100%">
        <tbody>
            <tr>
                <td id="selectedcolor" bgcolor="#ff8080" width="12%">
                </td>
                <td id="colorcode" align="center" width="75%">
                    <b>#FF8080</b>
                </td>
                <td width="12%">
                    <div id="transparent" style="cursor: pointer; visibility: hidden;">
                        <img src="images/transparent.gif" onmouseover="javascript:onTransparent();" onclick="javascript:onClickTransparent();previewText();">
                    </div>
                </td>
            </tr>
        </tbody>
    </table>
    <table id="colortable" style="border: 1px solid rgb(127, 157, 185); cursor: pointer;
        height: 115px;" bgcolor="#ffffff" border="0" cellpadding="1" cellspacing="2"
        width="100%">
        <tbody>
            <!--<tr><td bgcolor="#ff8080" height="17"></td><td bgcolor="#ffff80" height="17"></td><td bgcolor="#80ff80" height="17"></td><td bgcolor="#00ff80" height="17"></td><td bgcolor="#80ffff" height="17"></td><td bgcolor="#0080ff" height="17"></td><td bgcolor="#ff80c0" height="17"></td><td bgcolor="#ff80ff" height="17"></td></tr><tr><td bgcolor="#ff0000" height="17"></td><td bgcolor="#ffff00" height="17"></td><td bgcolor="#80ff00" height="17"></td><td bgcolor="#00ff40" height="17"></td><td bgcolor="#00ffff" height="17"></td><td bgcolor="#0080c0" height="17"></td><td bgcolor="#8080c0" height="17"></td><td bgcolor="#ff00ff" height="17"></td></tr><tr><td bgcolor="#804040" height="17"></td><td bgcolor="#ff8040" height="17"></td><td bgcolor="#00ff00" height="17"></td><td bgcolor="#008080" height="17"></td><td bgcolor="#004080" height="17"></td><td bgcolor="#8080ff" height="17"></td><td bgcolor="#800040" height="17"></td><td bgcolor="#ff0080" height="17"></td></tr><tr><td bgcolor="#800000" height="17"></td><td bgcolor="#ff8000" height="17"></td><td bgcolor="#008000" height="17"></td><td bgcolor="#008040" height="17"></td><td bgcolor="#0000ff" height="17"></td><td bgcolor="#0000a0" height="17"></td><td bgcolor="#800080" height="17"></td><td bgcolor="#8000ff" height="17"></td></tr><tr><td bgcolor="#400000" height="17"></td><td bgcolor="#804000" height="17"></td><td bgcolor="#004000" height="17"></td><td bgcolor="#004040" height="17"></td><td bgcolor="#000080" height="17"></td><td bgcolor="#000040" height="17"></td><td bgcolor="#400040" height="17"></td><td bgcolor="#400080" height="17"></td></tr><tr><td bgcolor="#000000" height="17"></td><td bgcolor="#808000" height="17"></td><td bgcolor="#808040" height="17"></td><td bgcolor="#808080" height="17"></td><td bgcolor="#408080" height="17"></td><td bgcolor="#c0c0c0" height="17"></td><td bgcolor="#400040" height="17"></td><td bgcolor="#ffffff" height="17"></td></tr>-->
        </tbody>
    </table>
    <iframe src="selling-basic-adspace-add_files/blank_003.html" style="position: absolute;
        visibility: inherit; top: 0px; left: 0px; width: 204px; height: 142px; z-index: -1;"
        frameborder="0"></iframe>
</div>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td valign="top" align="center">
            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="20%" valign="top">
                        <?php include("left_pannel.php"); ?>
                    </td>
                    <td style="width: 10px;">
                        &nbsp;
                    </td>
                    <td valign="top">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td valign="top">
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td width="11">
                                                <img src="images/PinkBorderTopLeft.jpg" alt="" width="11" height="11">
                                            </td>
                                            <td class="PinkBoxTopBg">
                                                <img src="images/spacer.gif" alt="" width="10" height="11">
                                            </td>
                                            <td width="11">
                                                <img src="images/PinkBorderTopRight.jpg" alt="" width="11" height="11">
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td class="PinkTwosideBorder" valign="top">
                                    <table width="100%" class="center" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td align="left" valign="top">
                                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                    <tr>
                                                        <td>
                                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                <tr>
                                                                    <td width="29">
                                                                        <img src="images/TitleArrowLeft.jpg" alt="" width="29" height="30">
                                                                    </td>
                                                                    <td class="MarketTitleBg">
                                                                        <?php echo REGISTER_TXT;?>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="center">
                                                            <br />
                                                            <br />
                                                            <br />
                                                            <?php stepInfo();?>
	<form name="gtb_layout" id="frm_step2" method="POST" action="" enctype="multipart/form-data">
                                                            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="admob-Height">
                                                                <tr>
                                                                    <!--	<body id="tab1">
				<ul id="tabnav">
				<li class="tab1"><a href="customize_ad.php?sid=<?php echo $_REQUEST['sid'];?>">Build Layout</a></li>
				<li class="tab2"><a href="#">Add Details</a></li>
				<li class="tab3"><a href="#">Get Code</a></li>
				</ul>
	</body>-->
                                                                    <form id="basicLayout" name='gtb_layout' action="" method="post" class="tight-layout">
                                                                    <td width="400" valign="top" style="padding-left: 10px;">
                                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                            <tr>
                                                                                <td class="admob-SquareBoxTilteBg">
                                                                                    Ad Space Characteristics
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td class="admob-SquareBoxBorder">
                                                                                    <table width="100%" border="0" cellpadding="0" cellspacing="2" class="admob-FormContent">
                                                                                        <tr>
                                                                                            <td width="150" height="25">
                                                                                                <strong>Ad Space Type:</strong>
                                                                                            </td>
                                                                                            <td>
                                                                                                <select id="adspaceType" name="adspace_type" class="admob-CustomizeSmallDropDown">
                                                                                                    <option value="text" selected="selected">Text</option>
                                                                                                    <option value="banner">Banner</option>
                                                                                                    <option value="thumbnail">Thumbnail</option>
                                                                                                    <option value="customize_commBreak">Commercial Break</option>
                                                                                                </select>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td width="150" height="25">
                                                                                                <strong>Ad Name:</strong>
                                                                                            </td>
                                                                                            <td>
                                                                                                <input type="text" name='adname' class="admob-CustomizeInputBox" />
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td width="150" height="25" valign="top">
                                                                                                Description:
                                                                                            </td>
                                                                                            <td>
                                                                                                <textarea name='addesc' class="admob-CustomizeInputBox" style="width: 180px; height: 80px"></textarea>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td width="150" height="25" valign="top">
																								Begin Date:
                                                                                            </td>
                                                                                            <td>
                                                                                            <div style="clear:both"></div>
	<input class='admob-CustomizeInputBox'
	type="text" name="begin_date"  readonly='true' value="" id='begin_date' onclick="javascript:NewCal('begin_date','yyyymmdd',false,24);"/></td>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td colspan="2">
                                                                                                <!-- coombreak customize-->
                                                                                                <div style="padding: 3px; text-align: left;display:none" class="custom-ad-zone" datafld='customize_commBreak'>
                            <table style="text-align: left;" class="normal-table" align="center" width='100%'>
                                <tbody>
                                    <tr>
                                        <td colspan="2">
                                            <table width='100%' cellpadding='0' cellspacing='0'>
                                                <tbody>                                                   
                                                    <tr>
                                                        <td width='148'>
                                                        Height:
                                                        </td>
                                                        <td>
                                                            
                                                            <select class="flat admob-CustomizeInputBox" id="customize_height" name="customize_height" onchange="javascript:previewCustomize()">
                                                                <option label="63" value="63" selected="selected">63</option>
                                                                <option label="64" value="64">64</option>
                                                                <option label="65" value="65">65</option>
                                                                <option label="66" value="66">66</option>
                                                                <option label="67" value="67">67</option>
                                                                <option label="68" value="68">68</option>
                                                                <option label="69" value="69">69</option>
                                                                <option label="70" value="70">70</option>
                                                                <option label="71" value="71">71</option>
                                                                <option label="72" value="72">72</option>
                                                                <option label="73" value="73">73</option>
                                                                <option label="74" value="74">74</option>
                                                                <option label="75" value="75">75</option>
                                                                <option label="76" value="76">76</option>
                                                                <option label="77" value="77">77</option>
                                                                <option label="78" value="78">78</option>
                                                                <option label="79" value="79">79</option>
                                                                <option label="80" value="80">80</option>
                                                                <option label="81" value="81">81</option>
                                                                <option label="82" value="82">82</option>
                                                                <option label="83" value="83">83</option>
                                                                <option label="84" value="84">84</option>
                                                                <option label="85" value="85">85</option>
                                                                <option label="86" value="86">86</option>
                                                                <option label="87" value="87">87</option>
                                                                <option label="88" value="88">88</option>
                                                                <option label="89" value="89">89</option>
                                                                <option label="90" value="90">90</option>
                                                                <option label="91" value="91">91</option>
                                                                <option label="92" value="92">92</option>
                                                                <option label="93" value="93">93</option>
                                                                <option label="94" value="94">94</option>
                                                                <option label="95" value="95">95</option>
                                                                <option label="96" value="96">96</option>
                                                                <option label="97" value="97">97</option>
                                                                <option label="98" value="98">98</option>
                                                                <option label="99" value="99">99</option>
                                                                <option label="100" value="100">100</option>
                                                            </select>
                                                            pixels
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                        Color:
                                                        </td>
                                                        <td>
                                                            
                                                            <input id="customize_background_color" name="customize_background_color" class="flat admob-CustomizeInputBox" size="10" maxlength="11"
                                                                value="#6699CC" onchange="javascript:commonPreview(previewCustomize);" type="text"><a class="colorformat">Background
                                                                    Color</a>
                                                            <img id="backgroundColorIcon" style="cursor: pointer; padding-left: 3px;" src="images/palette.gif"
                                                                alt="Palette" onclick="javascript: onClickPalette('customize_background_color', this, true);">
                                                        </td>
                                                    </tr>                                                   
                                                </tbody>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <hr border="0" style="border-top: 1px solid rgb(51, 51, 51); width: 325px;">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <table style="width: 100%;">
                                                <tbody>
                                                    <tr>
                                                        <td colspan="2" class="blackbold">
                                                            Publisher:
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width='148'>
                                                            Font Size:
                                                        </td>
                                                        <td>
                                                            <select id="fontSize" name="font_size" class="flat admob-CustomizeDropDown" onchange="javascript:previewCustomize()">
                                                                <option label="1" value="8">1</option>
                                                                <option label="2" value="9">2</option>
                                                                <option label="3" value="10">3</option>
                                                                <option label="4" value="11">4</option>
                                                                <option label="5" value="12">5</option>
                                                                <option label="6" value="13">6</option>
                                                                <option label="7" value="14">7</option>
                                                                <option label="8" value="15">8</option>
                                                                <option label="9" value="16">9</option>
                                                                <option label="10" value="17">10</option>
                                                                <option label="11" value="18">11</option>
                                                                <option label="12" value="19" selected="selected">12</option>
                                                            </select>
                                                            points
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            Font Type:
                                                        </td>
                                                        <td>
                                                            <select id="customize_font_type" name="customize_font_type" class="flat admob-CustomizeDropDownBig" onchange="javascript:previewCustomize()">
                                                                <option label="Arial" value="Arial" selected="selected">Arial</option>
                                                                <option label="Georgia" value="Georgia">Georgia</option>
                                                                <option label="Sans-serif" value="MS Sans Serif">Sans-serif</option>
                                                                <option label="Times" value="Times">Times</option>
                                                                <option label="Verdana" value="Verdana">Verdana</option>
                                                            </select>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            Color:
                                                        </td>
                                                        <td>
                                                            <input id="fontColor" name="font_color" class="flat admob-CustomizeInputBox" size="10" maxlength="11" value="#FFFFFF"
                                                                onchange="javascript:commonPreview(previewCustomize);" type="text"><a class="colorformat">Font
                                                                    Color</a>
                                                            <img id="fontColorIcon" style="cursor: pointer; padding-left: 3px;" src="images/palette.gif"
                                                                alt="Palette" onclick="javascript: onClickPalette('fontColor', this, false);">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            Attributes:
                                                        </td>
                                                        <td>
                                                            <span style="padding-right: 5px;">
                                                                <input id="fontBold" name="font_bold" onclick="javascript: previewCustomize();" type="checkbox"><label
                                                                    for="fontBold">Bold</label></span> <span style="padding-right: 5px;">
                                                                        <input id="fontUnderline" name="font_underline" onclick="javascript: previewCustomize();"
                                                                            type="checkbox"><label for="fontUnderline">Underline</label></span>
                                                            <span>
                                                                <input id="fontItalic" name="font_italic" onclick="javascript: previewCustomize();" type="checkbox"><label
                                                                    for="fontItalic">Italic</label></span>
                                                        </td>
                                                    </tr>                                                   
                                                </tbody>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                           
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <div style="display: none;">
                                                <input id="showSkip" name="show_skip" onclick="javascript: previewCustomize();" checked="checked"
                                                    type="checkbox">
                                                <label for="showSkip">
                                                    <span class="blackbold">Show Skip Ad Button</span></label>
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                                                                                                <!-- ad thumbnail customize-->
                                                                                                <div style="padding-left: 50px;display:none" class="custom-ad-zone" datafld='thumbnail'>
                                                                                                    <table align='center' style="text-align: left; display: none" class="normal-table custom-ad-zone"
                                                                                                        datafld='thumbnail' align="center">
                                                                                                        <tbody>
                                                                                                            <tr>
                                                                                                                <td colspan='2'>
                                                                                                                    <br />
                                                                                                                    <hr />
                                                                                                                    <br />
                                                                                                                </td>
                                                                                                            </tr>

                                                                                                            <script type="text/javascript" language="javascript" src="js.html"></script>

                                                                                                            <script type="text/javascript" language="javascript" src="JavaScripts/form.js"></script>

                                                                                                            <tr>
                                                                                                                <td colspan="2">
                                                                                                                    <fieldset style="margin: 0px; padding: 0px;">
                                                                                                                        <legend style="padding: 0px 5px; margin-left: 5px;">Components</legend>
                                                                                                                        <table style="text-align: left; line-height: 18px;">
                                                                                                                            <tbody>
                                                                                                                                <tr>
                                                                                                                                    <td>
                                                                                                                                        <input id="component_handle" name="handle" checked="checked" onclick="javascript:isChanged = true;setComponent(this);"
                                                                                                                                            type="checkbox"><label style="cursor: pointer;" for="component_handle">Handle</label>
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                        <input id="component_age" name="age" checked="checked" onclick="javascript:isChanged = true;setComponent(this);"
                                                                                                                                            type="checkbox"><label style="cursor: pointer;" for="component_age">Age</label>
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                        <input id="component_location" name="location" checked="checked" onclick="javascript:isChanged = true;setComponent(this);"
                                                                                                                                            type="checkbox"><label style="cursor: pointer;" for="component_location">Location</label>
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                                <tr>
                                                                                                                                    <td>
                                                                                                                                        <input id="component_headline" name="headline" checked="checked" onclick="javascript:isChanged = true;setComponent(this);"
                                                                                                                                            type="checkbox"><label style="cursor: pointer;" for="component_headline">Headline</label>
                                                                                                                                    </td>
                                                                                                                                    <!--<td>
                                                                                                                  <input id="component_brokerLink" name="brokerLink" checked="checked" onclick="javascript:isChanged = true;setComponent(this);" type="checkbox"><label style="cursor: pointer;" for="component_brokerLink">Broker Link</label>
                                                                                                                </td>-->
                                                                                                                                    <td>
                                                                                                                                        <input id="component_image" name="image" checked="checked" onclick="javascript:isChanged = true;setComponent(this);"
                                                                                                                                            type="checkbox"><label style="cursor: pointer;" for="component_image">Image</label>
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                                <tr>
                                                                                                                                    <td>
                                                                                                                                        <input style="display: none;" id="component_header" name="header" checked="checked"
                                                                                                                                            onclick="javascript:isChanged = true;setComponent(this);" type="checkbox"><label
                                                                                                                                                style="cursor: pointer; display: none;" for="component_header">Header</label>
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                            </tbody>
                                                                                                                        </table>

                                                                                                                        <script type="text/javascript" language="javascript">
                                                                                                                //fixed bug #3888, Header checkbox shall only be available when it is off/unchecked
                                                                                                                var headerComponent = document.getElementById('component_header');
                                                                                                                if (headerComponent.checked) {
                                                                                                                    headerComponent.style.display = 'none';
                                                                                                                    headerComponent.nextSibling.style.display = 'none';
                                                                                                                }
                                                                                                                </script>

                                                                                                                    </fieldset>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td colspan="2">
                                                                                                                    <hr>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td colspan="2">
                                                                                                                    <fieldset>
                                                                                                                        <legend style="padding: 0px 5px; margin-left: 5px;">Thumbs</legend>
                                                                                                                        <div style="padding: 3px;">
                                                                                                                            Size:
                                                                                                                            <select class="flat" id="thumbSize" name="thumb_size" onchange="javascript:isChanged = true;setImageSize(this.value);">
                                                                                                                                <option label="40x40" value="40x40">40x40</option>
                                                                                                                                <option label="60x60" value="60x60" selected="selected">60x60</option>
                                                                                                                                <option label="80x80" value="80x80">80x80</option>
                                                                                                                                <option label="100x100" value="100x100">100x100</option>
                                                                                                                                <option label="120x120" value="120x120">120x120</option>
                                                                                                                                <option label="140x140" value="140x140">140x140</option>
                                                                                                                                <option label="160x160" value="160x160">160x160</option>
                                                                                                                            </select>&nbsp;&nbsp;&nbsp;&nbsp; View:
                                                                                                                            <select class="flat" id="thumbCount" name="thumb_count" onchange="javascript:isChanged = true;previewer.setCount(this.value);">
                                                                                                                                <option label="1" value="1">1</option>
                                                                                                                                <option label="2" value="2">2</option>
                                                                                                                                <option label="3" value="3">3</option>
                                                                                                                                <option label="4" value="4" selected="selected">4</option>
                                                                                                                                <option label="5" value="5">5</option>
                                                                                                                                <option label="6" value="6">6</option>
                                                                                                                                <option label="7" value="7">7</option>
                                                                                                                                <option label="8" value="8">8</option>
                                                                                                                                <option label="9" value="9">9</option>
                                                                                                                                <option label="10" value="10">10</option>
                                                                                                                            </select>
                                                                                                                        </div>
                                                                                                                    </fieldset>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td colspan="2">
                                                                                                                    <hr>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td colspan="2">
                                                                                                                    <fieldset>
                                                                                                                        <legend style="padding: 0px 5px; margin-left: 5px;">Thumbnail Size (pixels)</legend>
                                                                                                                        <table style="width: 100%;">
                                                                                                                            <tbody>
                                                                                                                                <tr>
                                                                                                                                    <td>
                                                                                                                                        Width:
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                        <input id="width" name="width" class="flat" value="264" style="width: 80px; color: rgb(128, 128, 128);"
                                                                                                                                            readonly="readonly" onkeyup="javascript:isChanged = true;setSize(gtbWidthInputElement.value, gtbHeightInputElement.value);"
                                                                                                                                            type="text">
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                        Height:
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                        <input id="height" name="height" class="flat" value="212" style="width: 80px; color: rgb(128, 128, 128);"
                                                                                                                                            readonly="readonly" onkeyup="javascript:isChanged = true;setSize(gtbWidthInputElement.value, gtbHeightInputElement.value);"
                                                                                                                                            type="text">
                                                                                                                                    </td>
                                                                                                                                </tr>

                                                                                                                                <script language="javascript" type="text/javascript">
                                                                                                        <!--
                                                                                                        function enableCustomGtbSize(checkBox) {
                                                                                                            if (checkBox.checked) {
                                                                                                                gtbWidthInputElement.readOnly = false;
                                                                                                                gtbHeightInputElement.readOnly = false;
                                                                                                                gtbWidthInputElement.style.color = '#000000';
                                                                                                                gtbHeightInputElement.style.color = '#000000';
                                                                                                                setSize(gtbWidthInputElement.value, gtbHeightInputElement.value);
                                                                                                            }
                                                                                                            else {
                                                                                                                gtbWidthInputElement.readOnly = true;
                                                                                                                gtbHeightInputElement.readOnly = true;
                                                                                                                gtbWidthInputElement.style.color = '#808080';
                                                                                                                gtbHeightInputElement.style.color = '#808080';
                                                                                                                setSize();
                                                                                                            }
                                                                                                        }

                                                                                                        function popupStyleWindow(id,inmode) {
                                                                                                            header = document.getElementById('headerContentStyle');
                                                                                                            body = document.getElementById('bodyContentStyle');
                                                                                                            //borker = document.getElementById('brokerLinkStyle');

                                                                                                            //closes all style windows first
                                                                                                            header.style.display = 'none';
                                                                                                            body.style.display = 'none';
                                                                                                            //borker.style.display = 'none';

                                                                                                            document.getElementById(id).style.display = '';

                                                                                                            window.scrollTo(0, document.getElementById(id).offsetTop);
                                                                                                        document.getElementById('insertmode').value = inmode;

                                                                                                        }
                                                                                                        var gtbWidthInputElement = document.getElementById('width');
                                                                                                        var gtbHeightInputElement = document.getElementById('height');
                                                                                                        
                                                                                                        -->
                                                                                                        </script>

                                                                                                                                <tr>
                                                                                                                                    <td colspan="4">
                                                                                                                                        <input id="customGtbSize" name="custom_gtb_size" onclick="javascript:isChanged = true;enableCustomGtbSize(this);"
                                                                                                                                            type="checkbox">
                                                                                                                                        <label style="cursor: pointer;" for="customGtbSize">
                                                                                                                                            Custom Thumbnail Size</label>
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                            </tbody>
                                                                                                                        </table>
                                                                                                                    </fieldset>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td colspan="2">
                                                                                                                    <hr>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td>
                                                                                                                    Background Color:
                                                                                                                </td>
                                                                                                                <td>
																													<input id="thumb_background_color" name="thumb_background_color" class="flat" size="10" maxlength="11" value="#80FF00"
                                                                                                                        onchange="javascript: isChanged = true;commonPreview(preview);;" type="text"><a class="colorformat">Background
                                                                                                                            Color</a>
                                                                                                                    <img style="cursor: pointer; padding-left: 3px;" src="images/palette.gif" alt="Palette"
                                                                                                                        onclick="javascript: onClickPalette('thumb_background_color', this, true);">
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td>
                                                                                                                    Orientation:
                                                                                                                </td>
                                                                                                                <td>
                                                                                                                    <input id="thumbnail_horizontal" name="thumbnail_alignment" value="horizontal" checked="checked" onclick="javascript:isChanged = true;setView();"
                                                                                                                        type="radio">
                                                                                                                    <label style="cursor: pointer;" for="horizontal">
                                                                                                                        Horizontal</label>
                                                                                                                    <input id="thumbnail_vertical" name="thumbnail_alignment" value="vertical" onclick="javascript:isChanged = true;setView();"
                                                                                                                        type="radio">
                                                                                                                    <label style="cursor: pointer;" for="vertical">
                                                                                                                        Vertical</label>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td colspan="2">
                                                                                                                    <hr>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td colspan="2">
                                                                                                                    <fieldset>
                                                                                                                        <legend>Thumbnail Appearance</legend>
                                                                                                                        <table cellpadding="0" cellspacing="0" width="100%">
                                                                                                                            <tbody>
                                                                                                                                <tr>
                                                                                                                                    <td width="50%">
                                                                                                                                    </td>
                                                                                                                                    <td width="50%">
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                                <tr>
                                                                                                                                    <td colspan="2">
                                                                                                                                        Click on banner or links below to control appearance.
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                                <tr>
                                                                                                                                    <input type="hidden" name="insertmode" id="insertmode">
                                                                                                                                    <td>
                                                                                                                                        <span style="cursor: pointer;" onclick="javascript:popupStyleWindow('headerContentStyle','insertheader')">
                                                                                                                                            <img src="images/a-b.gif" alt="">&nbsp;Header</span>
                                                                                                                                    </td>
                                                                                                                                    <td>
                                                                                                                                        <span style="cursor: pointer;" onclick="javascript:popupStyleWindow('bodyContentStyle','insertbody')">
                                                                                                                                            <img src="images/a-b.gif" alt="">&nbsp;Body</span>
                                                                                                                                    </td>
                                                                                                                                </tr>
                                                                                                                                <!--
                                                                                                                <tr>
                                                                                                                  <td>
                                                                                                                    <span style="cursor: pointer;" onclick="javascript:popupStyleWindow('brokerLinkStyle')"><img src="images/a-b.gif" alt="">&nbsp;Broker Link</span>
                                                                                                                  </td>
                                                                                                                  <td>
                                                                                                                  </td>
                                                                                                                </tr>-->
                                                                                                                            </tbody>
                                                                                                                        </table>
                                                                                                                    </fieldset>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td colspan="2" style="text-align: center;">
																													<a href="javascript: restoreDefaultThumbnail(); void 0;">restore defaults</a>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td colspan="2">
                                                                                                                    <div>
                                                                                                                        <input id="allowNetwork" name="allow_network" checked="checked" onchange="javascript:isChanged = true;"
                                                                                                                            onclick="checkSelect(this);" type="checkbox"><label style="padding-left: 5px;" for="allowNetwork"
                                                                                                                                class="blackbold">Allow Network Ads</label></div>
                                                                                                                </td>
                                                                                                            </tr>

                                                                                                            <script language="javascrip" type="text/javascript">
                                                                                                        <!--
                                                                                                        var message_warning_not_allow_network = "Warning! Network ads allow this ad space to always generate revenue, regardless of a direct ad purchase. If you choose to continue, please set your desired sale price for this ad space.";
                                                                                                        function checkSelect(obj) {
                                                                                                            if (false == obj.checked) {
                                                                                                                if(!confirm(message_warning_not_allow_network)) {
                                                                                                                    obj.checked = true;
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                        -->
                                                                                                        </script>

                                                                                                        </tbody>
                                                                                                    </table>
                                                                                                </div>
                                                                                                <!-- ad banner customize-->
                                                                                                <div style="padding: 3px; text-align: left; display: none" class='custom-ad-zone'
                                                                                                    datafld='banner'>
                                                                                                    <table style="text-align: left;" align="center" width="100%" cellpadding='0' cellspacing='0'>
                                                                                                        <tbody>
                                                                                                            <tr>
                                                                                                                <td width='150'>
                                                                                                                    Size:
                                                                                                                </td>
                                                                                                                <td>
                                                                                                                    <select id="banner-size" class="banner-size" name="banner_size" onchange="javascrip: previewBanner();window.changed = true;">
                                                                                                                        <option label="Vertical Banner (120 x 240)" value="120x240" selected="selected">Vertical
                                                                                                                            Banner (120 x 240)</option>
                                                                                                                        <option label="Mini Skyscraper(120 x 400)" value="120x400">Mini Skyscraper(120 x 400)</option>
                                                                                                                        <option label="Skyscraper (120 x 600)" value="120x600">Skyscraper (120 x 600)</option>
                                                                                                                        <option label="Square Button (125 x 125)" value="125x125">Square Button (125 x 125)</option>
                                                                                                                        <option label="Wide Skyscraper1 (150 x 600)" value="150x600">Wide Skyscraper1 (150 x
                                                                                                                            600)</option>
                                                                                                                        <option label="Wide Skyscraper2 (160 x 600)" value="160x600">Wide Skyscraper2 (160 x
                                                                                                                            600)</option>
                                                                                                                        <option label="Wide Skyscraper3 (200 x 480)" value="200x480">Wide Skyscraper3 (200 x
                                                                                                                            480)</option>
                                                                                                                        <option label="Square (250 x 250)" value="250x250">Square (250 x 250)</option>
                                                                                                                        <option label="Medium Rectangle (300 x 250)" value="300x250">Medium Rectangle (300 x
                                                                                                                            250)</option>
                                                                                                                        <option label="Medium Rectangle 2 (300 x 210)" value="300x210">Medium Rectangle 2 (300
                                                                                                                            x 210)</option>
                                                                                                                        <option label="Medium Rectangle 3 (400 x 250)" value="400x250">Medium Rectangle 3 (400
                                                                                                                            x 250)</option>
                                                                                                                        <option label="Full Banner (468 x 60)" value="468x60">Full Banner (468 x 60)</option>
                                                                                                                        <option label="Leader Board (728 x 90)" value="728x90">Leader Board (728 x 90)</option>
                                                                                                                        <option label="Large Leader Board (728 x 300)" value="728x300">Large Leader Board (728
                                                                                                                            x 300)</option>
                                                                                                                        <option label="Large Leader Board 2 (768 x 245)" value="768x245">Large Leader Board
                                                                                                                            2 (768 x 245)</option>
                                                                                                                    </select>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <!--######################### code on 25_07_09 starts####################-->
                                                                                                            <tr>
                                                                                                                <td>
                                                                                                                    #Ads Type:
                                                                                                                </td>
                                                                                                                <td>
                                                                                                                    <select id="banner_ad_Type" name="banner_ad_Type" class="flat">
                                                                                                                        <option label="direct" value="direct" selected="selected">Direct</option>
                                                                                                                        <option label="network" value="network">Network</option>
                                                                                                                    </select>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <!--######################### code on 25_07_09 ends #####################-->
                                                                                                            <tr>
                                                                                                                <td colspan="2">
                                                                                                                <br/>
                                                                                                                    <div style="font-weight: bold; color: rgb(0, 0, 0);">
                                                                                                                        Template Appearance</div>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td colspan="2">
                                                                                                                    <input id="use_template" name="template_setting" value="off" onclick="setTemplateAppearance(false);"
                                                                                                                        checked="true" type="radio">
                                                                                                                    <label for="use_template">
                                                                                                                        Use Template Setting</label>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                             <tr>
                                                                                                                <td colspan="2">
                                                                                                                    <input id="config_appearance" name="template_setting" value="on" onclick="setTemplateAppearance(true);"
                                                                                                                        type="radio">
                                                                                                                    <label for="config_appearance">
                                                                                                                        Configure Appearance</label>
                                                                                                                </td>
                                                                                                            </tr>
																											<tr>
																												<td colspan="2">
																												<br/>
																													<div style="font-weight: bold; color: rgb(0, 0, 0);">
																													Ad Space Image</div>
																												</td>
																											</tr>
																											<tr>
																												<td colspan="2">
																													<input type="file"  name="banner"/>
																												</td>
																											</tr>
                                                                                                           
                                                                                                        </tbody>
                                                                                                    </table>
                                                                                                    <table id="configAppearanceTable" style="width: 330px; display: none;">
                                                                                                        <tbody>
                                                                                                            <tr>
                                                                                                                <td style="width: 29%;">
                                                                                                                    Background Color:
                                                                                                                </td>
                                                                                                                <td style="width: 36%;">
                                                                                                                    <input id="banner-backgroundColor" name="banner_background_color" class="flat" size="10"
                                                                                                                        maxlength="10" value="" onchange="window.changed = true;changeStyle('color', this, 'previewBackgroundColor');"
                                                                                                                        type="text">
                                                                                                                    <a class=""></a>
                                                                                                                    <img style="cursor: pointer; padding-left: 3px;" src="images/palette.gif" alt="label_text_palette"
                                                                                                                        onclick="javascript: onClickPalette('banner-backgroundColor', this, false);">
                                                                                                                </td>
                                                                                                                <td style="width: 35%;">
                                                                                                                    <div id="previewBackgroundColor" style="height: 18px;">
                                                                                                                        Background Color
                                                                                                                    </div>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td colspan="3">
                                                                                                                    Header:
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td style="padding-left: 20px;">
                                                                                                                    Font Type:
                                                                                                                </td>
                                                                                                                <td colspan="2">
                                                                                                                    <select id="headerFontType" class="flat" name="header_font_type" onchange="window.changed = true;changeStyle('fontType', this, 'previewHeaderStyle');">
                                                                                                                        <option label="Arial" value="Arial">Arial</option>
                                                                                                                        <option label="Georgia" value="Georgia">Georgia</option>
                                                                                                                        <option label="Sans-serif" value="MS Sans Serif">Sans-serif</option>
                                                                                                                        <option label="Times" value="Times">Times</option>
                                                                                                                        <option label="Verdana" value="Verdana">Verdana</option>
                                                                                                                    </select>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td style="padding-left: 20px;">
                                                                                                                    Color:
                                                                                                                </td>
                                                                                                                <td>
                                                                                                                    <input id="headerColor" name="header_bg_color" class="flat" size="10" maxlength="10"
                                                                                                                        value="" onchange="window.changed = true;changeStyle('color', this, 'previewHeaderStyle');"
                                                                                                                        type="text">
                                                                                                                    <a class="">Color</a><img style="cursor: pointer; padding-left: 3px;" src="images/palette.gif"
                                                                                                                        alt="label_text_palette" onclick="onClickPalette('headerColor', this, false);">
                                                                                                                </td>
                                                                                                                <td>
                                                                                                                    <div id="previewHeaderStyle" style="height: 18px; padding-left: 5px; font-family: arial;">
                                                                                                                        Header Sample</div>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td colspan="3">
                                                                                                                    Body:
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td style="padding-left: 20px;">
                                                                                                                    Font Type:
                                                                                                                </td>
                                                                                                                <td colspan="2">
                                                                                                                    <select id="bodyFontType" class="flat" name="body_font_type" onchange="window.changed = true;changeStyle('fontType', this, 'previewBodyStyle');">
                                                                                                                        <option label="Arial" value="Arial">Arial</option>
                                                                                                                        <option label="Georgia" value="Georgia">Georgia</option>
                                                                                                                        <option label="Sans-serif" value="MS Sans Serif">Sans-serif</option>
                                                                                                                        <option label="Times" value="Times">Times</option>
                                                                                                                        <option label="Verdana" value="Verdana">Verdana</option>
                                                                                                                    </select>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td style="padding-left: 20px;">
                                                                                                                    Color:
                                                                                                                </td>
                                                                                                                <td>
                                                                                                                    <input id="bodyColor" name="body_bg_color" class="flat" size="10" maxlength="10"
                                                                                                                        value="" onchange="window.changed = true;changeStyle('color', this, 'previewBodyStyle');"
                                                                                                                        type="text">
                                                                                                                    <a class="">Color</a><img style="cursor: pointer; padding-left: 3px;" src="images/palette.gif"
                                                                                                                        alt="label_text_palette" onclick="javascript: onClickPalette('bodyColor', this, false);">
                                                                                                                </td>
                                                                                                                <td>
                                                                                                                    <div id="previewBodyStyle" style="height: 18px; padding-left: 5px; font-family: arial;">
                                                                                                                        Body Sample</div>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                        </tbody>
                                                                                                    </table>
                                                                                                    <div style="padding-top: 10px; padding-bottom: 10px; font-weight: bold;">
                                                                                                        Note: If this banner ad space does not have a direct ad campaign running, a banner
                                                                                                        template will be used that will display text ads, thumbnail ads and/or banner ads
                                                                                                        from our network.</div>
                                                                                                </div>
                                                                                                <!-- ad text customize-->
                                                                                                <table datafld='text' class='custom-ad-zone' width='100%' cellpadding='0' cellspacing='0'
                                                                                                    border='0'>
                                                                                                    <tr>
                                                                                                        <td height="25" width='151'>
                                                                                                            #Ads:
                                                                                                        </td>
                                                                                                        <td>
                                                                                                            <select id="cellCount" name="cell_count" class="admob-CustomizeDropDown" onchange="javascript: previewText();">
                                                                                                                <option label="1" value="1" selected="selected">1</option>
                                                                                                                <option label="2" value="2">2</option>
                                                                                                                <option label="3" value="3">3</option>
                                                                                                                <option label="4" value="4">4</option>
                                                                                                                <option label="5" value="5">5</option>
                                                                                                                <option label="6" value="6">6</option>
                                                                                                                <option label="7" value="7">7</option>
                                                                                                                <option label="8" value="8">8</option>
                                                                                                                <option label="9" value="9">9</option>
                                                                                                                <option label="10" value="10">10</option>
                                                                                                                <option label="11" value="11">11</option>
                                                                                                                <option label="12" value="12">12</option>
                                                                                                                <option label="13" value="13">13</option>
                                                                                                                <option label="14" value="14">14</option>
                                                                                                                <option label="15" value="15">15</option>
                                                                                                                <option label="16" value="16">16</option>
                                                                                                                <option label="17" value="17">17</option>
                                                                                                                <option label="18" value="18">18</option>
                                                                                                                <option label="19" value="19">19</option>
                                                                                                                <option label="20" value="20">20</option>
                                                                                                            </select>
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                    <!--######################### code on 29_06_09 starts####################-->
                                                                                                    <tr>
                                                                                                        <td height="25%">
                                                                                                            #Ads Type:
                                                                                                        </td>
                                                                                                        <td>
                                                                                                            <select id="text_ad_Type" name="text_ad_Type" class="admob-CustomizeDropDownBig">
                                                                                                                <option label="direct" value="direct" selected="selected">Direct</option>
                                                                                                                <option label="network" value="network">Network</option>
                                                                                                            </select>
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                    <!--######################### code on 29_06_09 ends #####################-->
                                                                                                    <tr>
                                                                                                        <td height="40%">
                                                                                                            View:
                                                                                                        </td>
                                                                                                        <td>
                                                                                                            <div id="horizontalView">
                                                                                                                <input id="text_horizontal" name="text_alignment" value="horizontal" onclick="javascript: previewText();"
                                                                                                                    type="radio"><label for="horizontal">Horizontal</label></div>
                                                                                                            <div id="verticalView">
                                                                                                                <input id="text_vertical" name="text_alignment" value="vertical" checked="checked" onclick="javascript: previewText();"
                                                                                                                    type="radio"><label for="vertical">Vertical</label></div>
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                    <!--         <tr><td colspan="2"><hr></td></tr>   -->
                                                                                                    <tr>
                                                                                                        <td height="25%">
                                                                                                            Standard Size:
                                                                                                        </td>
                                                                                                        <td>
                                                                                                            <select id="size" name="size" class="admob-CustomizeLargeDropDown" onchange="javascript: if('160x100'==this.value)restoreDefaultSize();else previewText();">
                                                                                                                <option label="None" value="160x100" selected="selected">None</option>
                                                                                                                <option label="Standard Rectangle (184 x 360)" value="184x360">Standard Rectangle (184
                                                                                                                    x 360)</option>
                                                                                                                <option label="Full Banner (468 x 60)" value="468x60">Full Banner (468 x 60)</option>
                                                                                                                <option label="Half Banner (234 x 60)" value="234x60">Half Banner (234 x 60)</option>
                                                                                                                <option label="Leader Board (728 x 90)" value="728x90">Leader Board (728 x 90)</option>
                                                                                                                <option label="Square Button (125 x 125)" value="125x125">Square Button (125 x 125)</option>
                                                                                                                <option label="Vertical Banner (120 x 240)" value="120x240">Vertical Banner (120 x 240)</option>
                                                                                                                <option label="Small Rectangle (180 x 150)" value="180x150">Small Rectangle (180 x 150)</option>
                                                                                                                <option label="Medium Rectangle (300 x 250)" value="300x250">Medium Rectangle (300 x
                                                                                                                    250)</option>
                                                                                                                <option label="Large Rectangle (336 x 280)" value="336x280">Large Rectangle (336 x 280)</option>
                                                                                                                <option label="Square Pop-up (250 x 250)" value="250x250">Square Pop-up (250 x 250)</option>
                                                                                                                <option label="Skyscraper (120 x 600)" value="120x600">Skyscraper (120 x 600)</option>
                                                                                                                <option label="Wide Skyscraper (160 x 600)" value="160x600">Wide Skyscraper (160 x 600)</option>
                                                                                                            </select>
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                    <tr>
                                                                                                        <td height="25%">
                                                                                                            Font Type:
                                                                                                        </td>
                                                                                                        <td>
                                                                                                            <select id="fontType" name="font_type" class="admob-CustomizeDropDownBig" onchange="javascript: previewText();">
                                                                                                                <option label="Arial" value="Arial" selected="selected">Arial</option>
                                                                                                                <option label="Georgia" value="Georgia">Georgia</option>
                                                                                                                <option label="Sans-serif" value="MS Sans Serif">Sans-serif</option>
                                                                                                                <option label="Times" value="Times">Times</option>
                                                                                                                <option label="Verdana" value="Verdana">Verdana</option>
                                                                                                            </select>
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                    <tr>
                                                                                                        <td height="25%">
                                                                                                            Background Color:
                                                                                                        </td>
                                                                                                        <td>
                                                                                                            <input id="backgroundColor" name="text_background_color" class="admob-CustomizeInputBox"
                                                                                                                size="10" maxlength="11" value="#E8E8E8" onchange="javascript: commonPreview(preview);"
                                                                                                                type="text"><a class="colorformat">Background Color</a><img style="cursor: pointer;
                                                                                                                    padding-left: 3px;" src="images/palette.gif" alt="Palette" onclick="javascript: onClickPalette('backgroundColor', this, true);">
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                    <tr>
                                                                                                        <td height="25%">
                                                                                                            Headline Color:
                                                                                                        </td>
                                                                                                        <td>
                                                                                                            <input id="titleColor" name="title_color" class="admob-CustomizeInputBox" size="10"
                                                                                                                maxlength="10" value="#0000FF" onchange="javascript: commonPreview(preview);"
                                                                                                                type="text"><a class="colorformat">Headline Color</a><img style="cursor: pointer;
                                                                                                                    padding-left: 3px;" src="images/palette.gif" alt="Palette" onclick="javascript: onClickPalette('titleColor', this);">
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                    <tr>
                                                                                                        <td height="25%">
                                                                                                            Description Color:
                                                                                                        </td>
                                                                                                        <td>
                                                                                                            <input id="descriptionColor" name="description_color" class="admob-CustomizeInputBox"
                                                                                                                size="10" maxlength="10" value="#000000" onchange="javascript: commonPreview(preview);"
                                                                                                                type="text"><a class="colorformat">Description Color</a><img style="cursor: pointer;
                                                                                                                    padding-left: 3px;" src="images/palette.gif" alt="Palette" onclick="javascript: onClickPalette('descriptionColor', this);">
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                    <tr>
                                                                                                        <td height="25%">
                                                                                                            Hide Broker Link:
                                                                                                        </td>
                                                                                                        <td>
                                                                                                            <select id="brokerLinkHide" name="broker_link_hide" class="admob-CustomizeDropDown"
                                                                                                                onchange="javascript: hideBrokerLink(); previewText();">
                                                                                                                <option value="No" selected="selected">No</option>
                                                                                                                <option value="Yes">Yes</option>
                                                                                                            </select><br />
                                                                                                            <a href="javascript: restoreDefault();" class="admob-RightLink">restore defaults</a>
                                                                                                        </td>
                                                                                                    </tr>

                                                                                                    <script language="javascrip" type="text/javascript">
					                                                                    <!--
					                                                                    var message_warning_not_allow_network = "Warning! Network ads allow this ad space to always generate revenue, regardless of a direct ad purchase. If you choose to continue, please set your desired sale price for this ad space.";
					                                                                    function checkSelect(obj) {
						                                                                    if (false == obj.checked) {
							                                                                    if(!confirm(message_warning_not_allow_network)) {
								                                                                    obj.checked = true;
							                                                                    }
						                                                                    }
					                                                                    }
					                                                                    -->
					                                                                    </script>

                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>
                                                                                                &nbsp;
                                                                                            </td>
                                                                                            <td>
                                                                                                &nbsp;
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td height="25">
                                                                                                &nbsp;
                                                                                            </td>
                                                                                            <td>
                                                                                                <table border="0" align="left" cellpadding="0" cellspacing="0">
                                                                                                    <tr>
                                                                                                        <td>
                                                                                                            <input id="customAdSpace" name="custom_adspace" value="" disabled="disabled" type="hidden">
                                                                                                            <input name="back" value="Back" class="admob-InputButton" "
                                                                                                                type="submit">
                                                                                                        </td>
                                                                                                        <td width="10">
                                                                                                            &nbsp;
                                                                                                        </td>
                                                                                                        <td>
                                                                                                            <input name="submit" value="Next" class="admob-InputButton" onclick="return validateStep2();"
                                                                                                                type="submit">
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                    <td width="13" valign="top">
                                                                        &nbsp;
                                                                    </td>
                                                                    <td width="450" valign="top" style="padding-right: 10px;">
                                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                            <tr>
                                                                                <td class="admob-SquareBoxTilteBg">
                                                                                    Preview
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td class="admob-SquareBoxBorder">
                                                                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                                        <tr>
                                                                                            <td>
                                                                                                <div style="padding: 3px; text-align: left;">
                                                                                                    <!--customize beak preview area--->
                                                                                                    <div id="previewAreaHolder" style="width: 485px;display:none" class="preview-area" datafld="customize_commBreak">
                                                                                                        <div id="cb_ad_preview">
                                                                                                            <div id="adHeader" style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 0px;
                                                                                                                width: 100%; height: 63px; background-color: rgb(102, 153, 204); background-image: url();">
                                                                                                                <table style="width: 100%; height: 100%;" border="0" cellpadding="0" cellspacing="0">
                                                                                                                    <tbody>
                                                                                                                        <tr id="headerBody" style="margin: 0px; padding: 0px; vertical-align: middle; height: 41px;">
                                                                                                                            <td style="text-align: left; padding-left: 20px;">
                                                                                                                                <div id="publisherLogo" style="font-size: 19px; font-family: Arial; color: rgb(255, 255, 255);
                                                                                                                                    font-weight: normal; text-decoration: none; font-style: normal;">
                                                                                                                                    Publisher Site Name</div>
                                                                                                                            </td>
                                                                                                                            <td style="text-align: right; padding-right: 20px;">
                                                                                                                                <div style="display: block;" id="skipButton">
                                                                                                                                    <input value="Skip Ad &gt;&gt;" style="border-width: 0px; font-family: verdana; font-size: 12px;
                                                                                                                                        color: rgb(0, 0, 0); font-weight: bold; background-color: transparent; background-image: url(images/cb_skip_ad_button.gif);
                                                                                                                                        width: 100px; height: 22px;" type="button">
                                                                                                                                </div>
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr style="vertical-align: middle; text-align: left;">
                                                                                                                            <td colspan="2" style="margin: 0px; padding: 0px;">
                                                                                                                                <div style="background-image: url(images/cb_advertiser_bg.gif); height: 22px; padding-left: 20px;">
                                                                                                                                    <span style="font-family: verdana; font-size: 11px; color: rgb(0, 0, 0);">An Advertisement
                                                                                                                                        By <span id="advertiserName" style="font-weight: bold;">Advertiser Name</span>
                                                                                                                                        <img src="images/arrow_down.png" style="padding-top: 7px;">
                                                                                                                                    </span>
                                                                                                                                </div>
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                    </tbody>
                                                                                                                </table>
                                                                                                            </div>
                                                                                                        </div>
                                                                                                        <div id="notice" style="color: red; display: none;">
                                                                                                            Notice: Preview may not display correctly due to security settings in your browser.</div>
                                                                                                    </div>
                                                                                                    <!-- thumbnail Preview Area-->
																									<div style="padding: 3px; text-align: left;display:none" class="preview-area" datafld="thumbnail" id="p-thumbnail" >
                                                                                                        <div>

                                                                                                            <script type="text/javascript" language="javascript" src="js.html"></script>

                                                                                                            <script type="text/javascript" src="JavaScripts/gtb-previewer.js"></script>

                                                                                                            <!--<script type="text/javascript" src="JavaScripts/common.js"></script>-->

                                                                                                            <script language="javascript" type="text/javascript">
<!--
var title = "Header Goes Here";
var titleField = false;
if ((titleField = document.getElementById('headline'))
        && (titleField.type) && ('text' == titleField.type)
        && ('' != titleField.value)) {
    title = titleField.value;
}

var ad = {
    //requestURL: 'show-gallery-entry.php',
    spacer: 'images/spacer.gif',
    //baseURL: '?sid=2d47b082c2e464ec257bb48468c0ddfb',
    space: {
        rating: 'sfw',
        themeId: 1,
        style: {
                    cells: 4,
            view: 'horizontal',
            backgroundColor: '#6cdae7',
            imageWidth: 60,
            imageHeight: 60,
            showHandle:  true ,
            showAge:  true ,
            showLocation:  true ,
            showHeadline:  true ,
            showBrokerLink:  true ,
            showImage:  true ,
            showHeader:  true ,
            headStyle: 'fontFamily:Arial;fontSize:15px;color:#000000;textDecoration:none;fontWeight:bold;fontStyle:normal;textAlign:center',
            bodyStyle: 'fontFamily:Arial;fontSize:13px;color:#000000;textDecoration:none;fontWeight:normal;fontStyle:normal;textAlign:center',
//             brokerLinkStyle: 'fontFamily:Arial;fontSize:11px;color:#000000;textDecoration:none;fontWeight:normal;fontStyle:normal;textAlign:center'
        }
    },
    payment: {
        title: title
    },
    location: {
            //latitude: 22.5697,
       // longitude: 88.3697,
        //cityName: 'Calcutta',
            nearbyCities: []
    }
};

function setComponent(checkBox) {
    previewer.setComponent(checkBox.name, checkBox.checked);
}

function setImageSize(size) {
    size = size.toLowerCase().split('x');
    previewer.setImageSize(size[0], size[1]);
}

function setSize(width, height) {
    if (2 != arguments.length) {
        previewer.setSize();
    }
    else {
        previewer.setSize(width, height);
    }
}

function setView() {
    if (document.getElementById('thumbnail_horizontal').checked) {
        previewer.setView(GTBPreviewer.HORIZONTAL);
    }
    else {
        previewer.setView(GTBPreviewer.VERTICAL);
    }
}

function closeStyleWindow(id) {
    document.getElementById(id).style.display='none';
}

function editStyle(self, targetSytleEditId) {
    obj = document.getElementById(targetSytleEditId);

    var top;
    var left;
    var xOffset;
    var yOffset;
    var windowWidth;
    var windowHeight;

    var isIE = document.all ? true : false;

    if (isIE) {
        var htmlObj = document.getElementsByTagName('html')[0];
        left = event.x + htmlObj.scrollLeft;
        top = event.y + htmlObj.scrollTop;
        xOffset = event.x;
        yOffset = event.y;
        windowWidth = htmlObj.clientWidth;
        windowHeight = htmlObj.clientHeight;
    }
    else {
        document.captureEvents(Event.MOUSEMOVE);
        left = self.pageX;
        top = self.pageY;
        xOffset = self.pageX - window.scrollX;
        yOffset = self.pageY - window.scrollY;
        windowWidth = window.innerWidth - 20;
        windowHeight = window.innerHeight;
    }
    obj.style.top = top + "px";
    obj.style.left = left + "px";
    document.getElementById("headerContentStyle").style.display = "none";
    document.getElementById("bodyContentStyle").style.display = "none";
    document.getElementById("brokerLinkStyle").style.display = "none";
    obj.style.display = "";

    //adjusts the position of style window
    if (xOffset + obj.offsetWidth > windowWidth) {
        obj.style.left = left - obj.offsetWidth + "px";
    }

    if (yOffset + obj.offsetHeight > windowHeight) {
        obj.style.top = top - obj.offsetHeight + "px";
    }
}

function editHeadStyle(e) {
    editStyle(e, "headerContentStyle");
}

function editBodyStyle(e) {
    editStyle(e, "bodyContentStyle");
}

function editBrokerLinkStyle(e) {
    editStyle(e, "brokerLinkStyle");
}

function compareColor() {
    var backgroundColorField = document.getElementById("backgroundColor");
    var titleColorField = document.getElementById("title_font_color");
    var descriptionColorField = document.getElementById("description_font_color");
    var brokerColorField = document.getElementById("broker_link_font_color");
    var colorReg = /^#[0-9a-fA-F]{6}$/;
    if ('TRANSPARENT' != backgroundColorField.value && ! colorReg.test(backgroundColorField.value)) {
        alert(alert_color_incorrect.replace('<field name>', backgroundColorField.nextSibling.firstChild.nodeValue));
        focusElement(backgroundColorField);
        return;
    }
    if (! colorReg.test(titleColorField.value)) {
        alert(alert_color_incorrect.replace('<field name>', titleColorField.nextSibling.firstChild.nodeValue));
        focusElement(titleColorField);
        return;
    }
    if (! colorReg.test(descriptionColorField.value)) {
        alert(alert_color_incorrect.replace('<field name>', descriptionColorField.nextSibling.firstChild.nodeValue));
        focusElement(descriptionColorField);
        return;
    }
    if (! colorReg.test(brokerColorField.value)) {
        alert(alert_color_incorrect.replace('<field name>', brokerColorField.nextSibling.firstChild.nodeValue));
        focusElement(brokerColorField);
        return;
    }
    var titleColor = titleColorField ? titleColorField.value : previewer.style.head.lastFontColor;

    if (!colorReg.test(titleColor) ||
        (!colorReg.test(backgroundColorField.value) && ('TRANSPARENT' != backgroundColorField.value))) {
        return false;
    }

    if (backgroundColorField.value.toUpperCase() == titleColor.toUpperCase()) {
        alert("Background color and font colors cannot be the same.");
        backgroundColorField.value = previewer.style.lastBackgroundColor;
        titleColorField.value = previewer.style.head.lastFontColor;
        return false;
    }

    return true;
}

function preview() {
    if (!compareColor()) return;
	previewer.style.lastBackgroundColor = document.getElementById('thumb_background_color').value;
    previewer.style.head.lastFontColor = document.getElementById('title_font_color').value;
    previewer.setBackgroundColor(document.getElementById("thumb_background_color").value);
    previewer.setStyle('head', 'color', document.getElementById("title_font_color").value);
    previewer.setStyle('body', 'color', document.getElementById("description_font_color").value);
    previewer.setStyle('brokerLink', 'color', document.getElementById("broker_link_font_color").value);
}

var previewer = new GTBPreviewer(ad);
previewer.render();
previewer.style.lastBackgroundColor = previewer.style.background;
previewer.style.head.lastFontColor = previewer.style.head.color;
var warning = document.createElement('div');
warning.style.display = 'none';
previewer.adBlock.parentNode.insertBefore(warning, previewer.adBlock);
var warningMessage = 'The ad cannot be shown correctly because the specified size is too small.';
warning.innerHTML = '<span class="warning">Warning: ' + warningMessage + '</span><br /><br />';
previewer.onOverflow = function (isOverflow) {
    warning.style.display = isOverflow ? 'block' : 'none';
}

    previewer.setHeadOnClickHandler(editHeadStyle);
    previewer.setBodyOnClickHandler(editBodyStyle);
    previewer.setBrokerLinkOnClickHandler(editBrokerLinkStyle);

    if (gtbWidthInputElement && gtbWidthInputElement) {
        previewer.onSizeChange = function (width, height) {
            gtbWidthInputElement.value = width;
            gtbHeightInputElement.value = height;
        }
    }
// -->
	
</script>

                                                                                                            <div id="bodyContentStyle" style="display: none; position: absolute; width: 280px;">
                                                                                                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                                                                                    <tbody>
                                                                                                                        <tr>
                                                                                                                            <td style="width: 11px; height: 11px;">
                                                                                                                                <img src="images/top-left.gif" alt="">
                                                                                                                            </td>
                                                                                                                            <td style="width: 100%; background-image: url(images/top-mid.gif); background-repeat: repeat;">
                                                                                                                            </td>
                                                                                                                            <td style="width: 11px;">
                                                                                                                                <img src="images/top-right.gif" alt="">
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="width: 11px; background-image: url(images/left-mid.gif); background-repeat: repeat;">
                                                                                                                            </td>
                                                                                                                            <td style="background: rgb(249, 247, 247) none repeat scroll 0%; width: 100%; -moz-background-clip: -moz-initial;
                                                                                                                                -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
                                                                                                                                <table width="100%">
                                                                                                                                    <tbody>
                                                                                                                                        <tr>
                                                                                                                                            <td style="text-align: center;">
                                                                                                                                                Body Style Edit
                                                                                                                                            </td>
                                                                                                                                            <td style="width: 16px;">
                                                                                                                                                <img style="cursor: pointer;" src="images/closing-button.bmp" alt="" onclick="javascript:closeStyleWindow('bodyContentStyle')">
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                    </tbody>
                                                                                                                                </table>
                                                                                                                                <table style="text-align: left;">
                                                                                                                                    <tbody>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Font Size:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <select id="description_font_size" class="flat" name="description_font_size" onchange="javascript:isChanged = true;previewer.setStyle('body', 'fontSize', this.value+'px');">
                                                                                                                                                    <option label="1" value="8">1</option>
                                                                                                                                                    <option label="2" value="9">2</option>
                                                                                                                                                    <option label="3" value="10">3</option>
                                                                                                                                                    <option label="4" value="11">4</option>
                                                                                                                                                    <option label="5" value="12">5</option>
                                                                                                                                                    <option label="6" value="13" selected="selected">6</option>
                                                                                                                                                    <option label="7" value="14">7</option>
                                                                                                                                                    <option label="8" value="15">8</option>
                                                                                                                                                    <option label="9" value="16">9</option>
                                                                                                                                                    <option label="10" value="17">10</option>
                                                                                                                                                </select>
                                                                                                                                                points
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Font Type:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <select class="flat" id="description_font_type" name="description_font_type" onchange="javascript:isChanged = true;previewer.setStyle('body', 'fontFamily', this.value);">
                                                                                                                                                    <option label="Arial" value="Arial" selected="selected">Arial</option>
                                                                                                                                                    <option label="Georgia" value="Georgia">Georgia</option>
                                                                                                                                                    <option label="Sans-serif" value="MS Sans Serif">Sans-serif</option>
                                                                                                                                                    <option label="Times" value="Times">Times</option>
                                                                                                                                                    <option label="Verdana" value="Verdana">Verdana</option>
                                                                                                                                                </select>
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Color:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <input id="description_font_color" name="description_font_color" class="flat" size="10"
                                                                                                                                                    maxlength="10" value="#000000" onchange="javascript:isChanged = true;commonPreview(preview);"
                                                                                                                                                    type="text"><a class="colorformat">Body Color</a>
                                                                                                                                                <img style="cursor: pointer; padding-left: 3px;" src="images/palette.gif" alt="Palette"
                                                                                                                                                    onclick="javascript:onClickPalette('description_font_color', this, false);">
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Attributes:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <input id="description_bold" name="description_bold" size="25" value="Bold" onclick="javascript:isChanged = true;var value=this.checked?'bold':'normal'; previewer.setStyle('body', 'fontWeight', value);"
                                                                                                                                                    type="checkbox">
                                                                                                                                                <label style="cursor: pointer;" for="description_bold">
                                                                                                                                                    Bold</label>
                                                                                                                                                <input id="description_underline" name="description_underline" size="25" value="Underline"
                                                                                                                                                    onclick="isChanged = true;var value=this.checked?'underline':'none'; previewer.setStyle('body', 'textDecoration', value);"
                                                                                                                                                    type="checkbox">
                                                                                                                                                <label style="cursor: pointer;" for="description_underline">
                                                                                                                                                    Underline</label>
                                                                                                                                                <input id="description_italic" name="description_italic" size="25" value="Italic"
                                                                                                                                                    onclick="isChanged = true;var value=this.checked?'italic':'normal'; previewer.setStyle('body', 'fontStyle', value);"
                                                                                                                                                    type="checkbox">
                                                                                                                                                <label style="cursor: pointer;" for="description_italic">
                                                                                                                                                    Italic</label>
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Horizontal Align:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <select class="flat" id="description_align" name="description_align" onchange="javascript:isChanged = true;previewer.setStyle('body', 'textAlign', this.value);">
                                                                                                                                                    <option value="left">Left</option>
                                                                                                                                                    <option value="center" selected="selected">Center</option>
                                                                                                                                                    <option value="right">Right</option>
                                                                                                                                                </select>
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                    </tbody>
                                                                                                                                </table>
                                                                                                                            </td>
                                                                                                                            <td style="width: 11px; background-image: url(images/right-mid.gif); background-repeat: repeat;">
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="height: 11px;">
                                                                                                                                <img src="images/bottom-left.gif" alt="">
                                                                                                                            </td>
                                                                                                                            <td style="width: 100%; background-image: url(images/bottom-mid.gif); background-repeat: repeat;">
                                                                                                                            </td>
                                                                                                                            <td>
                                                                                                                                <img src="images/bottom-right.gif" alt="">
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                    </tbody>
                                                                                                                </table>
                                                                                                            </div>
                                                                                                            <div id="headerContentStyle" style="display: none; position: absolute; width: 280px;">
                                                                                                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                                                                                    <tbody>
                                                                                                                        <tr>
                                                                                                                            <td style="width: 11px; height: 11px;">
                                                                                                                                <img src="images/top-left.gif" alt="">
                                                                                                                            </td>
                                                                                                                            <td style="width: 100%; background-image: url(images/top-mid.gif); background-repeat: repeat;">
                                                                                                                            </td>
                                                                                                                            <td style="width: 11px;">
                                                                                                                                <img src="images/top-right.gif" alt="">
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="width: 11px; background-image: url(images/left-mid.gif); background-repeat: repeat;">
                                                                                                                            </td>
                                                                                                                            <td style="background: rgb(249, 247, 247) none repeat scroll 0%; width: 100%; -moz-background-clip: -moz-initial;
                                                                                                                                -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
                                                                                                                                <table width="100%">
                                                                                                                                    <tbody>
                                                                                                                                        <tr>
                                                                                                                                            <td style="text-align: center;">
                                                                                                                                                Header Style Edit
                                                                                                                                            </td>
                                                                                                                                            <td style="width: 16px;">
                                                                                                                                                <img style="cursor: pointer;" src="images/closing-button.bmp" alt="" onclick="javascript:closeStyleWindow('headerContentStyle')">
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                    </tbody>
                                                                                                                                </table>
                                                                                                                                <table style="text-align: left;">
                                                                                                                                    <tbody>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Font Size:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <select id="title_font_size" class="flat" name="title_font_size" onchange="javascript:isChanged = true;previewer.setStyle('head', 'fontSize', this.value+'px');">
                                                                                                                                                    <option label="1" value="8">1</option>
                                                                                                                                                    <option label="2" value="9">2</option>
                                                                                                                                                    <option label="3" value="10">3</option>
                                                                                                                                                    <option label="4" value="11">4</option>
                                                                                                                                                    <option label="5" value="12">5</option>
                                                                                                                                                    <option label="6" value="13">6</option>
                                                                                                                                                    <option label="7" value="14">7</option>
                                                                                                                                                    <option label="8" value="15" selected="selected">8</option>
                                                                                                                                                    <option label="9" value="16">9</option>
                                                                                                                                                    <option label="10" value="17">10</option>
                                                                                                                                                </select>
                                                                                                                                                points
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Font Type:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <select class="flat" id="title_font_type" name="title_font_type" onchange="javascript:isChanged = true;previewer.setStyle('head', 'fontFamily', this.value);">
                                                                                                                                                    <option label="Arial" value="Arial" selected="selected">Arial</option>
                                                                                                                                                    <option label="Georgia" value="Georgia">Georgia</option>
                                                                                                                                                    <option label="Sans-serif" value="MS Sans Serif">Sans-serif</option>
                                                                                                                                                    <option label="Times" value="Times">Times</option>
                                                                                                                                                    <option label="Verdana" value="Verdana">Verdana</option>
                                                                                                                                                </select>
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Color:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <input id="title_font_color" name="title_font_color" class="flat" size="10" maxlength="10"
                                                                                                                                                    value="#000000" onchange="javascript:isChanged = true;commonPreview(preview);"
                                                                                                                                                    type="text"><a class="colorformat">Headline Color</a>
                                                                                                                                                <img style="cursor: pointer; padding-left: 3px;" src="images/palette.gif" alt="Palette"
                                                                                                                                                    onclick="javascript: onClickPalette('title_font_color', this, false);">
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Attributes:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <input id="title_bold" name="title_bold" size="25" value="Bold" checked="checked"
                                                                                                                                                    onclick="javascript:isChanged = true;var value=this.checked?'bold':'normal'; previewer.setStyle('head', 'fontWeight', value);"
                                                                                                                                                    type="checkbox">
                                                                                                                                                <label style="cursor: pointer;" for="title_bold">
                                                                                                                                                    Bold</label>
                                                                                                                                                <input id="title_underline" name="title_underline" size="25" value="Underline" onclick="isChanged = true;var value=this.checked?'underline':'none'; previewer.setStyle('head', 'textDecoration', value);"
                                                                                                                                                    type="checkbox">
                                                                                                                                                <label style="cursor: pointer;" for="title_underline">
                                                                                                                                                    Underline</label>
                                                                                                                                                <input id="title_italic" name="title_italic" size="25" value="Italic" onclick="isChanged = true;var value=this.checked?'italic':'normal'; previewer.setStyle('head', 'fontStyle', value);"
                                                                                                                                                    type="checkbox">
                                                                                                                                                <label style="cursor: pointer;" for="title_italic">
                                                                                                                                                    Italic</label>
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Horizontal Align:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <select class="flat" id="title_align" name="title_align" onchange="javascript:isChanged = true;previewer.setStyle('head', 'textAlign', this.value);">
                                                                                                                                                    <option value="left">Left</option>
                                                                                                                                                    <option value="center" selected="selected">Center</option>
                                                                                                                                                    <option value="right">Right</option>
                                                                                                                                                </select>
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                    </tbody>
                                                                                                                                </table>
                                                                                                                            </td>
                                                                                                                            <td style="width: 11px; background-image: url(images/right-mid.gif); background-repeat: repeat;">
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="height: 11px;">
                                                                                                                                <img src="images/bottom-left.gif" alt="">
                                                                                                                            </td>
                                                                                                                            <td style="width: 100%; background-image: url(images/bottom-mid.gif); background-repeat: repeat;">
                                                                                                                            </td>
                                                                                                                            <td>
                                                                                                                                <img src="images/bottom-right.gif" alt="">
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                    </tbody>
                                                                                                                </table>
                                                                                                            </div>
                                                                                                            <div id="brokerLinkStyle" style="display: none; position: absolute; width: 280px;">
                                                                                                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                                                                                    <tbody>
                                                                                                                        <tr>
                                                                                                                            <td style="width: 11px; height: 11px;">
                                                                                                                                <img src="images/top-left.gif" alt="">
                                                                                                                            </td>
                                                                                                                            <td style="width: 100%; background-image: url(images/top-mid.gif); background-repeat: repeat;">
                                                                                                                            </td>
                                                                                                                            <td style="width: 11px;">
                                                                                                                                <img src="images/top-right.gif" alt="">
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="width: 11px; background-image: url(images/left-mid.gif); background-repeat: repeat;">
                                                                                                                            </td>
                                                                                                                            <td style="background: rgb(249, 247, 247) none repeat scroll 0%; width: 100%; -moz-background-clip: -moz-initial;
                                                                                                                                -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
                                                                                                                                <table width="100%">
                                                                                                                                    <tbody>
                                                                                                                                        <tr>
                                                                                                                                            <td style="text-align: center;">
                                                                                                                                                Broker Link Style Edit
                                                                                                                                            </td>
                                                                                                                                            <td style="width: 16px;">
                                                                                                                                                <img style="cursor: pointer;" src="images/closing-button.bmp" alt="" onclick="javascript:closeStyleWindow('brokerLinkStyle')">
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                    </tbody>
                                                                                                                                </table>
                                                                                                                                <table style="text-align: left;">
                                                                                                                                    <tbody>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Font Size:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <select id="broker_link_font_size" class="flat" name="broker_link_font_size" onchange="javascript:isChanged = true;previewer.setStyle('brokerLink', 'fontSize', this.value+'px');">
                                                                                                                                                    <option label="1" value="8">1</option>
                                                                                                                                                    <option label="2" value="9">2</option>
                                                                                                                                                    <option label="3" value="10">3</option>
                                                                                                                                                    <option label="4" value="11" selected="selected">4</option>
                                                                                                                                                    <option label="5" value="12">5</option>
                                                                                                                                                    <option label="6" value="13">6</option>
                                                                                                                                                    <option label="7" value="14">7</option>
                                                                                                                                                    <option label="8" value="15">8</option>
                                                                                                                                                    <option label="9" value="16">9</option>
                                                                                                                                                    <option label="10" value="17">10</option>
                                                                                                                                                </select>
                                                                                                                                                points
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Font Type:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <select class="flat" id="broker_link_font_type" name="broker_link_font_type" onchange="javascript:isChanged = true;previewer.setStyle('brokerLink', 'fontFamily', this.value);">
                                                                                                                                                    <option label="Arial" value="Arial" selected="selected">Arial</option>
                                                                                                                                                    <option label="Georgia" value="Georgia">Georgia</option>
                                                                                                                                                    <option label="Sans-serif" value="MS Sans Serif">Sans-serif</option>
                                                                                                                                                    <option label="Times" value="Times">Times</option>
                                                                                                                                                    <option label="Verdana" value="Verdana">Verdana</option>
                                                                                                                                                </select>
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Color:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <input id="broker_link_font_color" name="broker_link_font_color" class="flat" size="10"
                                                                                                                                                    maxlength="10" value="#000000" onchange="javascript:isChanged = true;commonPreview(preview);"
                                                                                                                                                    type="text"><a class="colorformat">Broker Link Color</a>
                                                                                                                                                <img style="cursor: pointer; padding-left: 3px;" src="images/palette.gif" alt="Palette"
                                                                                                                                                    onclick="javascript: onClickPalette('broker_link_font_color', this, false);">
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Attributes:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <input id="broker_link_bold" name="broker_link_bold" size="25" value="Bold" onclick="javascript:isChanged = true;var value=this.checked?'bold':'normal'; previewer.setStyle('brokerLink', 'fontWeight', value);"
                                                                                                                                                    type="checkbox">
                                                                                                                                                <label style="cursor: pointer;" for="broker_link_bold">
                                                                                                                                                    Bold</label>
                                                                                                                                                <input id="broker_link_underline" name="broker_link_underline" size="25" value="Underline"
                                                                                                                                                    onclick="javascript:isChanged = true;var value=this.checked?'underline':'none'; previewer.setStyle('brokerLink', 'textDecoration', value);"
                                                                                                                                                    type="checkbox">
                                                                                                                                                <label style="cursor: pointer;" for="broker_link_underline">
                                                                                                                                                    Underline</label>
                                                                                                                                                <input id="broker_link_italic" name="broker_link_italic" size="25" value="Italic"
                                                                                                                                                    onclick="javascript:isChanged = true;var value=this.checked?'italic':'normal'; previewer.setStyle('brokerLink', 'fontStyle', value);"
                                                                                                                                                    type="checkbox">
                                                                                                                                                <label style="cursor: pointer;" for="broker_link_italic">
                                                                                                                                                    Italic</label>
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                        <tr>
                                                                                                                                            <td>
                                                                                                                                                Horizontal Align:
                                                                                                                                            </td>
                                                                                                                                            <td>
                                                                                                                                                <select class="flat" id="broker_link_align" name="broker_link_align" onchange="javascript:isChanged = true;previewer.setStyle('brokerLink', 'textAlign', this.value);">
                                                                                                                                                    <option value="left">Left</option>
                                                                                                                                                    <option value="center" selected="selected">Center</option>
                                                                                                                                                    <option value="right">Right</option>
                                                                                                                                                </select>
                                                                                                                                            </td>
                                                                                                                                        </tr>
                                                                                                                                    </tbody>
                                                                                                                                </table>
                                                                                                                            </td>
                                                                                                                            <td style="width: 11px; background-image: url(images/right-mid.gif); background-repeat: repeat;">
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                        <tr>
                                                                                                                            <td style="height: 11px;">
                                                                                                                                <img src="images/bottom-left.gif" alt="">
                                                                                                                            </td>
                                                                                                                            <td style="width: 100%; background-image: url(images/bottom-mid.gif); background-repeat: repeat;">
                                                                                                                            </td>
                                                                                                                            <td>
                                                                                                                                <img src="images/bottom-right.gif" alt="">
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                    </tbody>
                                                                                                                </table>
                                                                                                            </div>
                                                                                                        </div>
                                                                                                        <div style="margin-top: 10px;">
                                                                                                            Please Note: Click on a specific property to edit it.</div>
                                                                                                    </div>
                                                                                                    <!-- banner Preview Area-->
                                                                                                    <div id="bannerPreview" class='preview-area' datafld='banner' style="display: none">
                                                                                                        <div>
                                                                                                            <img id="bannerImage" style="border: 1px solid rgb(127, 157, 185); width: 120px;
                                                                                                                height: 240px;" src="images/ad_test_120x240.jpg" alt="Banner Test" height="240"
                                                                                                                width="120"></div>
                                                                                                    </div>
                                                                                                    <!-- text preview area-->
                                                                                                    <table id="pTable" class='preview-area' datafld='text' style="border: 0px solid rgb(127, 157, 185);
                                                                                                        text-align: center;" cellpadding="0" cellspacing="0">
                                                                                                        <tbody>
                                                                                                            <tr id="pTr">
                                                                                                                <td id="pTd">
                                                                                                                    <table style="width: 240px; height: 79px; table-layout: fixed;" border="0" cellpadding="6"
                                                                                                                        cellspacing="6">
                                                                                                                        <tbody>
                                                                                                                            <!--<tr><td align="center" bgcolor="#ff8080" valign="top"><div style="overflow: hidden; width: 141px; height: 55px;" id="ad_0"><div style="color: rgb(0, 0, 255); font-family: Arial; font-size: 13px; font-weight: bold; text-decoration: underline;">Headline Goes Here</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 13px;">Ad description will go ...</div></div></td><td align="center" bgcolor="#ff8080" valign="top"><div style="overflow: hidden; width: 141px; height: 55px;" id="ad_1"><div style="color: rgb(0, 0, 255); font-family: Arial; font-size: 13px; font-weight: bold; text-decoration: underline;">Headline Goes Here</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 13px;">Ad description will go ...</div></div></td><td align="center" bgcolor="#ff8080" valign="top"><div style="overflow: hidden; width: 141px; height: 55px;" id="ad_2"><div style="color: rgb(0, 0, 255); font-family: Arial; font-size: 13px; font-weight: bold; text-decoration: underline;">Headline Goes Here</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 13px;">Ad description will go ...</div></div></td><td align="center" bgcolor="#ff8080" valign="top"><div style="overflow: hidden; width: 141px; height: 55px;" id="ad_3"><div style="color: rgb(0, 0, 255); font-family: Arial; font-size: 13px; font-weight: bold; text-decoration: underline;">Headline Goes Here</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 13px;">Ad description will go ...</div></div></td></tr>-->
                                                                                                                        </tbody>
                                                                                                                    </table>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                            <tr>
                                                                                                                <td style="text-align: left; height: 15px;">
                                                                                                                    <div id="brokerLink" style="border-width: 0px; display: inline; font-size: 11px;
                                                                                                                        font-family: arial; color: rgb(0, 0, 0); text-decoration: none; font-weight: normal;
                                                                                                                        font-style: normal;">
                                                                                                                        <a href="#" class="admob-RightLink"><span id="brokerLinkSpan">Advertise Here</span></a></div>
                                                                                                                </td>
                                                                                                            </tr>
                                                                                                        </tbody>
                                                                                                    </table>

                                                                                                    <script language="javascript" type="text/javascript">
<!--
var confirm_hide_link = "Are you sure? If you hide the link, people will not be able to advertise on your site or become your affiliate.";
var descriptionString = "Ad description will go here below the Headline.";
var titleString = "Headline Goes Here";
var descString = "Ad description will go here.";
// var warningMessage = "Warning: ";
// warningMessage += "The ad cannot be shown correctly because the specified size is too small.";
-->
</script>

                                                                                                </div>
                                                                                            </td>
                                                                                        </tr>
                                                                                        </tbody></table>
                                                                                </td>
                                                                            </tr>
                                                                            </tbody></table>
                                                                    </form>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="11">
                                    <img src="images/PinkBorderBottomLeft.jpg" alt="" width="11" height="11">
                                </td>
                                <td class="PinkBoxBottomBg">
                                    <img src="images/spacer.gif" alt="" width="10" height="11">
                                </td>
                                <td width="11">
                                    <img src="images/PinkBorderBottomRight.jpg" alt="" width="11" height="11">
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
        <td>
            &nbsp;
        </td>
    </tr>
</table>
</td> </tr> </table> </td> </tr> </table>
</form>

<script language="javascript" type="text/javascript">
<!--
    var transparent = "TRANSPARENT";

    var ns = document.getElementById&&!document.all; //boolean flag for netscape/firefox
    var objId; //object id
    var selected; //selected color
    var onchangeFlag = false;
    init();

    //Initialize the color table.
    function init() {
        var colors = new Array (
            ['#FF8080', '#FFFF80', '#80FF80', '#00FF80', '#80FFFF', '#0080FF', '#FF80C0', '#FF80FF'],
            ['#FF0000', '#FFFF00', '#80FF00', '#00FF40', '#00FFFF', '#0080C0', '#8080C0', '#FF00FF'],
            ['#804040', '#FF8040', '#00FF00', '#008080', '#004080', '#8080FF', '#800040', '#FF0080'],
            ['#800000', '#FF8000', '#008000', '#008040', '#0000FF', '#0000A0', '#800080', '#8000FF'],
            ['#400000', '#804000', '#004000', '#004040', '#000080', '#000040', '#400040', '#400080'],
            ['#000000', '#808000', '#808040', '#808080', '#408080', '#C0C0C0', '#400040', '#FFFFFF']
        );
        var table = document.getElementById("colortable");

        for (itr in colors) {
            var row = table.insertRow(-1);
            for (itd in colors[itr]) {
                var cell = row.insertCell(-1);
                cell.height = 17;
                cell.innerText = "";
                cell.bgColor = colors[itr][itd];

                //when move mouse to a cell, the selected color will changed
                cell.onmouseover = function() {
                    var colorcode = document.getElementById("colorcode");
                    colorcode.innerHTML = "<b>" + this.bgColor.toUpperCase() + "</b>";
                    var selectedcolor = document.getElementById("selectedcolor");
                    selectedcolor.bgColor = this.bgColor;
                    selected = selectedcolor;
                }
                //when mouse click, the selected color will be assigned to obj
                //and color palette will be closed
                cell.onclick  = function(){
                    if (objId != '') {
                        var obj = document.getElementById(objId);
                    }
                    obj.value = selected.bgColor.toUpperCase();
                    if (obj.onchange) {
                        obj.onchange();
                    }                    
                    onClickPalette('', null);
                    previewText();
                };
            }
        }
    }


    //It is called when mouse over transparent cell
    function onTransparent() {
        var colorcode = document.getElementById("colorcode");
        colorcode.innerHTML = "<b>" + transparent + "</b>";
        var selectedcolor = document.getElementById("selectedcolor");
        selectedcolor.bgColor = "Transparent";
    }


    //It is called when mouseclick on transparent cell
    function onClickTransparent() {
        if (objId != '') {
            var obj = document.getElementById(objId);
        }
        obj.value = 'TRANSPARENT';
        onClickPalette('', null);
    }

    //show or hide the palette
    //it also inits table data and div position
    function onClickPalette(objid, control, isTran, leftTopDisplay) {
        if (!document.all && onchangeFlag) {
            return;
        }
        var l = 0;
        var t = 0;
        var obj;
        if (objid != '') {
            obj = document.getElementById(objid);
            objId = objid;
        }

        //check that needs the transparent or not
        var transparent = document.getElementById("transparent");
        if (typeof(isTran) != "undefined") {
            transparent.style.visibility = (isTran) ? "inherit" : "hidden";
        }
        else {
            transparent.style.visibility = "hidden";
        }

        //calculate the control position
        if (control != null) {
            controlTop = control.offsetTop;
            controlLeft = control.offsetLeft + 20;
            while(control = control.offsetParent) {
                controlTop += control.offsetTop;
                controlLeft += control.offsetLeft;
            }
        }

        //init div position
        var div = document.getElementById('colorlayer');
        if (leftTopDisplay != null) {
            leftDistance = controlLeft - div.offsetWidth;
            topDistance = controlTop - div.offsetHeight;
            div.style.left = leftDistance + "px";
            div.style.top = topDistance + "px";
        }
        else {
            div.style.left = controlLeft + "px";
            div.style.top = controlTop + "px";
        }

        //init div data
        if (div.style.visibility == 'hidden') {
            var selectedcolor = document.getElementById('selectedcolor');
            selectedcolor.bgColor = obj.value;
            var colorcode = document.getElementById('colorcode');
            colorcode.innerHTML = "<b>" + obj.value.toUpperCase() + "</b>";
        }

        div.style.visibility = (div.style.visibility == 'hidden') ? 'visible' : 'hidden';
    }

    var inColorPalette = false;
    function mousedown() {
        if (!inColorPalette) {
            var div = document.getElementById('colorlayer');
            div.style.visibility = 'hidden';
        }
    }

    function leaveColorPalette() {
        inColorPalette=false;
    }

    function enterColorPalette() {
        inColorPalette=true;
    }

    document.onmousedown = mousedown;

-->
</script>

<script language="javascript"> 
<!--
function showWarning(isOverflow) {
    warning.style.display = isOverflow ? 'block' : 'none';
}

function hideBrokerLink(){
   if ("Yes" == document.getElementById("brokerLinkHide").value) {
       if (!window.confirm(confirm_hide_link)) {
           document.getElementById("brokerLinkHide").value = "No";
       }
   }            
}
function restoreDefault() {
    if (!document.all && onchangeFlag) {
        return;
    }    
    document.getElementById("size").options[0].selected = true;
    document.getElementById("vertical").checked = true;
    document.getElementById("cellCount").options[0].selected = true;
    document.getElementById("backgroundColor").value = "#E8E8E8";
    document.getElementById("titleColor").value = "#0000FF";
    document.getElementById("descriptionColor").value = "#000000";
    document.getElementById("fontType").value = "Arial";
    document.getElementById("brokerLinkHide").options[0].selected = true;
    previewText();
}

function restoreDefaultSize() {
    document.getElementById("cellCount").options[0].selected = true;
    document.getElementById("text_vertical").checked = true;
    previewText();
}

function previewText() {
    var elementTitleColor = document.getElementById("titleColor");
    var elementDescriptionColor = document.getElementById("descriptionColor");
    var elementBgColor = document.getElementById("backgroundColor");
    var reg = /^#[0-9a-fA-F]{6}$/;
    if ('TRANSPARENT' != elementBgColor.value && ! reg.test(elementBgColor.value)) {
        alert(alert_color_incorrect.replace('<field name>', elementBgColor.nextSibling.firstChild.nodeValue));
        focusElement(elementBgColor);
        return;
    }
    if (! reg.test(elementTitleColor.value)) {
        alert(alert_color_incorrect.replace('<field name>', elementTitleColor.nextSibling.firstChild.nodeValue));
        focusElement(elementTitleColor);
        return;
    }
    if (! reg.test(elementDescriptionColor.value)) {
        alert(alert_color_incorrect.replace('<field name>', elementDescriptionColor.nextSibling.firstChild.nodeValue));
        focusElement(elementDescriptionColor);
        return;
    }
    var fontName = document.getElementById("fontType").value;          
    var titleColor = document.getElementById("titleColor").value;
    var descriptionColor = document.getElementById("descriptionColor").value;
    var bgColor = document.getElementById("backgroundColor").value;
    var size = document.getElementById("size").value;
    document.getElementById("text_horizontal").readonly = true;
    document.getElementById("text_vertical").readonly = true;
    document.getElementById("cellCount").readonly = true;
    var alignment = "vertical";
    var titleFontSize = "13px";
    var descriptionFontSize = "13px";
    var titleText = titleString;
    var descriptionText = descriptionString;
    cellSpacing = 6;
    cellPadding = 6;
    rows = 1;
    cols = 1;
    sizes = size.split("x");
    totalWidth = sizes[0];
    totalHeight = sizes[1];

    switch (size) {
        case "184x360" :
            ads = 5;
            rows = 5;
            descriptionFontSize = "12px";
            break;
        case "468x60" :
            ads = 2;
            cellSpacing = 6;
            alignment = "horizontal";
            cols = 2;
            titleFontSize = "12px";
            descriptionFontSize = "11px";
            break;
        case "234x60" :
            ads = 1;
            cellSpacing = 6;
            titleFontSize = "12px";
            descriptionFontSize = "12px";
            break;
        case "728x90" :
            ads = 5;
            alignment = "horizontal";
            cols = 5;
            descriptionFontSize = "12px";
            descriptionText = descString;
            break;
        case "125x125" :
            ads = 1;
            cellSpacing = 0;
            titleFontSize = "12px";
            descriptionFontSize = "12px";
            break;
        case "120x240" :
            ads = 3;
            rows = 3;
            titleFontSize = "12px";
            descriptionFontSize = "12px";
            descriptionText = descString;
            break;
        case "180x150" :
            ads = 1;
            titleFontSize = "12px";
            descriptionFontSize = "12px";
            break;
        case "300x250" :
            ads = 4;
            cols = 2;
            rows = 2;
            break;
        case "336x280" :
            ads = 6;
            cols = 3;
            rows = 2;
            break;
        case "250x250" :
            ads = 4;
            cols = 2;
            rows = 2;
            break;
        case "120x600" :
            ads = 6;
            rows = 6;
            break;
        case "160x600" :
            ads = 7;
            rows = 7;
            break;
        default :
            document.getElementById("text_horizontal").readonly = false;
            document.getElementById("text_vertical").readonly = false;
            document.getElementById("cellCount").readonly = false;
            ads = document.getElementById("cellCount").value;
            cellSpacing = 6;
            if (document.getElementById("text_horizontal").checked) {
                alignment = "horizontal";
                cols = parseInt(ads);
            }
            else {
                rows = parseInt(ads);
            }
            width = sizes[0];
            height = sizes[1];
            totalWidth = width*cols;
            totalHeight = height*rows;
            break;
    }

    if ("vertical" == alignment) {
        document.getElementById("text_vertical").checked = true;
    }
    else {
        document.getElementById("text_horizontal").checked = true;
    }

    if ("No" == document.getElementById("brokerLinkHide").value) {
        totalHeight -= 21;
    }
    temp = cellPadding * (rows * 2) + cellSpacing * (rows + 1);
    height = Math.round((totalHeight - temp)/rows);
    temp = cellPadding * (cols * 2) + cellSpacing * (cols + 1);
    width = Math.round((totalWidth - temp)/cols);

    document.getElementById("cellCount").value = ads;
    document.getElementById("pTd").innerHTML = "";
    previewTable = document.createElement("TABLE");
    previewTableBody = document.createElement("TBODY");
    var index = 0;
    var ad_elements = new Array();
    for(j = 0; j < rows; j++) {
        currentRow = document.createElement("TR");
        for(i = 0; i < cols;i++) {
            currentCell = document.createElement("TD");
            if ("" != bgColor) {
                currentCell.bgColor = bgColor;
            }
            currentCell.vAlign = "top";
            currentCell.align = "center";
            content = document.createElement("DIV");
            content.id = "ad_" + index;
            ad_elements[index++] = content;
            content.style.overflow = "hidden";
            content.style.width = width + "px";
            content.style.height = height + "px";
            title = document.createElement("DIV");
            title.style.color = titleColor;
            title.style.fontFamily = fontName;
            title.style.fontSize = titleFontSize;
            title.style.fontWeight = "bold";
            title.style.textDecoration = "underline";
            titleContent = document.createTextNode(titleString);
            title.appendChild(titleContent);

            description = document.createElement("DIV");
            description.style.color = descriptionColor;
            description.style.fontFamily = fontName;
            description.style.fontSize = descriptionFontSize;
            descriptionContent = document.createTextNode(descriptionText);
            description.appendChild(descriptionContent);
            content.appendChild(title);
            content.appendChild(description);
            currentCell.appendChild(content);
            currentRow.appendChild(currentCell);
        }
        previewTableBody.appendChild(currentRow);
    }

    var brokerLinkElement = document.getElementById("brokerLink");

    if ("No" == document.getElementById("brokerLinkHide").value) {
        brokerLinkElement.style.display = "inline";
    }
    else {
        brokerLinkElement.style.display = "none";
    }
    previewTable.brokerLinkSpan = document.getElementById('brokerLinkSpan');
    previewTable.totalWidth = totalWidth;
    previewTable.appendChild(previewTableBody);
    previewTable.setAttribute("border", "0");
    previewTable.cellSpacing = cellSpacing;
    previewTable.cellPadding = cellPadding;
    previewTable.style.width = totalWidth + "px";
    previewTable.style.height = totalHeight + "px";
    previewTable.style.tableLayout = "fixed";

    document.getElementById("pTd").appendChild(previewTable);
    var striped = stripAllContents(ad_elements);
    if ("No" == document.getElementById("brokerLinkHide").value) {
        striped |= stripBrokerLink(previewTable);
    }

    if (isIE7()) {
        controlIE7Performance();
    }
    
    showWarning(striped);
    if ('undefined' != typeof(isChanged)){
       isChanged = true;
    }
}
-->
first=true;
    jQuery('document').ready(function(){
        //intilitize 
        jQuery('#adspaceType').change(function(){
	    jQuery('#gtb_ad_block_1').height('');	
	    jQuery('#gtb_ad_block_1').width('');
	    if(first)
		{
			jQuery('#width').val('264');
			jQuery('#height').val('215');
			first=false;
		}
            val = jQuery(this).find('option:selected').val();          
            jQuery('.custom-ad-zone').each(function(){
                if(jQuery(this).attr('datafld')==val)
                    // set display 
                    jQuery(this).css('display','');
                else
                    // hide
                    jQuery(this).hide();                
            });    
			//val = jQuery('.preview-area').find('option:selected').val();       
			jQuery('.preview-area').each(function(){
                if(jQuery(this).attr('datafld')==val)
                    // set display 
                    jQuery(this).css('display','');
                else
                    // hide
                    jQuery(this).hide();                
            }); 
        });	
        
    });
	function validateStep2()
	{
	var msg = '';
	var validate=true;
	val = jQuery.trim(jQuery('input[name=adname]').val());
	if(val=='')
	{
	validate=false;
	msg+="Ad Name is missing\n";
	}
	val = jQuery.trim(jQuery('textarea[name=addesc]').val());
	if(val=='')
	{
	validate=false;
	msg+="Ad Description is missing\n";
	}
	val = jQuery.trim(jQuery('input[name=begin_date]').val());
	if(val=='')
	{
	validate=false;	
	msg+="Begin Date is missing\n";
	}
	val = jQuery.trim(jQuery('#adspaceType option:selected').val());
	if(val=='banner'&&jQuery('input[name=banner]').val()=='')
	{
		validate=false;	
		msg+="Ad Space Image is missing\n";
	}
	if(val=='thumbnail'&&jQuery('input[name=thumbnail]').val()=='')
	{
		validate=false;	
		msg+="Ad Space Image is missing\n";
	}	
	if(!validate)
	alert(msg);
	return validate;
	}
	</script>

<!--Script for banner ad-->

<script language="javascript" type="text/javascript">
<!--

var confirm_hide_link = "Are you sure? If you hide the link, people will not be able to advertise on your site or become your affiliate.";
var alert_choose_website = "Please choose a website from the dropdown list";
var alert_same_header_color_and_background_color = "The background color and header color should not be the same.";
var alert_same_body_color_and_background_color = "The background color and body color should not be the same.";
var leave_message = "Do you want to save your changes?";
var image_path = "images/";
//var location_url = 'selling-adspace-list.php?sid=2d47b082c2e464ec257bb48468c0ddfb';
var old_size = "120x240";
var old_broker_hide = "No";
var confirm_edit_dimension_change = "The dimensions of this Ad Space have changed. If you are using Iframe Mode Ad Space Code, you will need to copy the new code and include it on your website in order for the dimensions appear correctly.";
var is_edit = false;

var changed = false;

function setTemplateAppearance(configAppearance) {
    if (configAppearance) {
        var configAppearanceTable = document.getElementById('configAppearanceTable');
        configAppearanceTable.style.display = 'block';
        var inputs = configAppearanceTable.getElementsByTagName('input');
        for (var i = 0; i < inputs.length; i++) {
            if ('text' == inputs[i].type) {
                nextSibling = inputs[i].nextSibling;
                if ((nextSibling != null) && (nextSibling.nodeType == 1) && (nextSibling.tagName == "A")){
                    nextSibling.className = 'colorformat';
                }
            }
        }
    }
    else {
        var configAppearanceTable = document.getElementById('configAppearanceTable');
        configAppearanceTable.style.display = 'none';
        var inputs = configAppearanceTable.getElementsByTagName('input');
        for (var i = 0; i < inputs.length; i++) {
            if ('text' == inputs[i].type) {
                nextSibling = inputs[i].nextSibling;
                if ((nextSibling != null) && (nextSibling.nodeType == 1) && (nextSibling.tagName == "A")){
                    nextSibling.className = '';
                }
            }
        }
    }
}

function changeStyle(type, srcElement, destElementName) {
    if ('color' == type) {
        var color = srcElement.value;
        if ('backgroundColor' == srcElement.id) {
            document.getElementById('previewBackgroundColor').style.backgroundColor = color;
            document.getElementById('previewHeaderStyle').style.backgroundColor = color;
            document.getElementById('previewBodyStyle').style.backgroundColor = color;
        }
        else {
            document.getElementById(destElementName).style.color = color;
        }
    }
    else if ('fontType' == type) {
        var fontType = srcElement.value;
        document.getElementById(destElementName).style.fontFamily = fontType;
    }
}

function processBack() {
    if (checkChange(changed, leave_message)) {
        window.location.href = location_url;
    }
}


function previewBanner() {    
    var image = document.getElementById("bannerImage");
    
    //var sizeObject = document.getElementById("size");
    
    var size = jQuery('.banner-size').find('option:selected').val();
    var sizes = size.split("x");
    var width = sizes[0];
    var height = sizes[1];
	//alert(image.src+' '+size);
    image.style.width = width + "px";
    image.style.height = height+ "px";
    image.src = image_path + "ad_test_" + size + ".jpg";

    if (isIE7()) {
        controlIE7Performance();
    }

}

function validate() {
    var result = true;   
    result = validateForm(document.getElementById("bannerAdSpace"));
    if (result == false) {
        return false;
    }
    if (result && document.getElementById('config_appearance').checked) {
        bgColor = document.getElementById('backgroundColor').value;
        headerColor = document.getElementById('headerColor').value;
        bodyColor = document.getElementById('bodyColor').value;
        if (bgColor == headerColor) {
            alert(alert_same_header_color_and_background_color);
            document.getElementById('headerColor').focus();
            result = false;
        }
        else if (bgColor == bodyColor) {
            alert(alert_same_body_color_and_background_color);
            document.getElementById('bodyColor').focus();
            result = false;
        }
    }

    return result && result2;
}
previewBanner();



-->
</script>

<!--Script for thumbnail-->

<script type="text/javascript" language="javascript">
        //fixed bug #3888, Header checkbox shall only be available when it is off/unchecked
        var headerComponent = document.getElementById('component_header');
        if (headerComponent.checked) {
            headerComponent.style.display = 'none';
            headerComponent.nextSibling.style.display = 'none';
        }
</script>

<script language="javascript" type="text/javascript">
<!--
function enableCustomGtbSize(checkBox) {
    if (checkBox.checked) {
        gtbWidthInputElement.readOnly = false;
        gtbHeightInputElement.readOnly = false;
        gtbWidthInputElement.style.color = '#000000';
        gtbHeightInputElement.style.color = '#000000';
        setSize(gtbWidthInputElement.value, gtbHeightInputElement.value);
    }
    else {
        gtbWidthInputElement.readOnly = true;
        gtbHeightInputElement.readOnly = true;
        gtbWidthInputElement.style.color = '#808080';
        gtbHeightInputElement.style.color = '#808080';
        setSize();
    }
}

function popupStyleWindow(id,inmode) {
    header = document.getElementById('headerContentStyle');
    body = document.getElementById('bodyContentStyle');
    //borker = document.getElementById('brokerLinkStyle');

    //closes all style windows first
    header.style.display = 'none';
    body.style.display = 'none';
    //borker.style.display = 'none';

    document.getElementById(id).style.display = '';

    window.scrollTo(0, document.getElementById(id).offsetTop);
document.getElementById('insertmode').value = inmode;

}
var gtbWidthInputElement = document.getElementById('width');
var gtbHeightInputElement = document.getElementById('height');
//var windowOnload = window.onload;
//window.onload = function() {
//    if (windowOnload) {
//        windowOnload();
//    }
//    enableCustomGtbSize(document.getElementById('customGtbSize'));
//}
//-->
</script>

<script language="javascrip" type="text/javascript">
<!--
var message_warning_not_allow_network = "Warning! Network ads allow this ad space to always generate revenue, regardless of a direct ad purchase. If you choose to continue, please set your desired sale price for this ad space.";
function checkSelect(obj) {
    if (false == obj.checked) {
        if(!confirm(message_warning_not_allow_network)) {
            obj.checked = true;
        }
    }
}
-->
</script>

<script language="javascrip" type="text/javascript">
<!--
var components = new Array();
components[components.length] = 'handle';
components[components.length] = 'age';
components[components.length] = 'location';
components[components.length] = 'headline';
//components[components.length] = 'brokerLink';
components[components.length] = 'image';
components[components.length] = 'header';
var websites_rating = new Array();
    websites_rating['72687'] = 'nsfw';
    websites_rating['72719'] = 'nsfw';
var default_theme = new Array();
    default_theme['sfw'] = '7';
    default_theme['nsfw'] = '6';
    default_theme['adult'] = '5';
var ratings = {'sfw' : 'Safe For Work', 'nsfw' : 'Not Safe For Work', 'adult' : 'Adult'};

function validateSite() {
    var form = document.getElementById("gtbLayout");

    

    var selectComponents = 0;
        if (form.handle.checked) {
        selectComponents++;
    }
        if (form.age.checked) {
        selectComponents++;
    }
        if (form.location.checked) {
        selectComponents++;
    }
        if (form.headline.checked) {
        selectComponents++;
    }
        if (form.brokerLink.checked) {
        selectComponents++;
    }
        if (form.image.checked) {
        selectComponents++;
    }
        if (form.header.checked) {
        selectComponents++;
    }
        if (0 == selectComponents) {
        alert("Please select at least one component.");
        return false;
    }

    return validateForm(form);
}


function storeLayout() {
    document.getElementById('gtbAdSpace').readonly = false;
    document.getElementById('gtbLayout').submit();
    return false;
}

function setDefaultOption(names) {
    for(var i = 0; i < names.length; ++i) {
        var name = names[i];        
        var options = document.gtb_layout[name].options;
        for(var j = 0; j < options.length; ++j) {
            options[j].selected = options[j].defaultSelected;
        }
    }
}

function setDefaultChecked(names) {
    for(var i = 0; i < names.length; ++i) {
        var it = document.gtb_layout[names[i]];	        
        it.checked = it.defaultChecked;
    }
}

//sets the fields to default
function resetForm() {
    setDefaultOption(['thumb_size', 'thumb_count',
            'description_font_size', 'description_font_type', 'description_align',
            'title_font_size', 'title_font_type', 'title_align',
            'broker_link_font_size', 'broker_link_font_type', 'broker_link_align']);
    setDefaultChecked(components.concat(['custom_gtb_size',
            'broker_link_bold', 'broker_link_underline', 'broker_link_italic',
            'title_bold', 'title_underline', 'title_italic',
            'description_italic', 'description_underline', 'description_bold']));
	document.gtb_layout.thumbnail_alignment[0].checked = document.gtb_layout.thumbnail_alignment[0].defaultChecked;
	document.gtb_layout.thumbnail_alignment[1].checked = document.gtb_layout.thumbnail_alignment[1].defaultChecked;
    document.gtb_layout.thumb_background_color.value = document.gtb_layout.thumb_background_color.defaultValue;
    document.gtb_layout.description_font_color.value = document.gtb_layout.description_font_color.defaultValue;
    document.gtb_layout.title_font_color.value = document.gtb_layout.title_font_color.defaultValue;
    
}

function restoreDefaultThumbnail() {    
    document.getElementById('width').readOnly = true;
    document.getElementById('width').style.color = '#808080';
    document.getElementById('height').readOnly = true;
    document.getElementById('height').style.color = '#808080';
    resetForm();
    //changeRating();
    previewer.initialize(ad);
    previewer.refresh();
}

// function changeRating() {
//     var website = document.getElementById('siteId');
//     var themeId = document.getElementById('themeId');
//     var contentRating = ratings[websites_rating[website.value]];
//     document.getElementById('websiteRating').innerHTML = (contentRating) ? contentRating : '';
//     document.getElementById('noTheme').style.display = (contentRating) ? 'none' : 'inline';
//     themeId.value = '0';
//     var currentSelect = null;
//     for (rating in ratings) {
//         currentSelect = document.getElementById(rating + 'Theme');
//         if (rating == websites_rating[website.value]) {
//             themeId.value = default_theme[rating];
//             currentSelect.value = default_theme[rating];
//             currentSelect.style.display = 'inline';
//         }
//         else {
//             currentSelect.style.display = 'none';
//         }
//     }
// }
resetForm();

// -->
var oldOnload = window.onload;
window.onload = function() {
    if (oldOnload) {
        oldOnload();
    }
    warning = document.createElement('div');
    
    warning.style.display = 'none';
    var previewTable = document.getElementById("pTable")
    previewTable.parentNode.insertBefore(warning, previewTable);
   // warning.innerHTML = '<span class="warning">' + warningMessage + '</span><br /><br />';

    previewText();
    if ('undefined' != typeof(isChanged)){
       isChanged = false;
       addLinksCheckChange(leave_message);
    }
    if (isIE7()) {
        controlIE7Performance();
    }
    if (document.getElementById('config_appearance').checked) {
        setTemplateAppearance(true);
    }  
    // load for thumbnail
     enableCustomGtbSize(document.getElementById('customGtbSize'));  
     addLinksCheckChange(message);
     refreshAd();
        if ('' != ad_style.body_src) {
        if (document.getElementById('adBody')) {
            window.frames['ad_body'].location.replace(ad_style.body_src);
        }
    }
    
}
</script>
<!--- script for customize beak-->
<script language="javascript" type="text/javascript">
<!--
var uploadFinish = false;
var ad_style = {
    'bg_height' : '63',
    'bg_color' : '#6699CC',
    'use_bg_img' : false,
    'bg_img_src' : '',
    'font_size' : '19',
    'font_type' : 'Arial',
    'font_color' : '#FFFFFF',
    'font_bold' : 'normal',
    'font_underline' : 'none',
    'font_italic' : 'normal',
    'use_logo' : false,
    'logo_src' : '',
    'show_skip' : true,
    'site_name' : 'Publisher Site Name',
    'advertiser_name' : 'Advertiser Name',
    'body_src' : ''
};



var refreshAd = function() {
    var ad_header = document.getElementById('adHeader');
    ad_header.style.height = ad_style.bg_height + 'px';
    ad_header.style.backgroundColor = ad_style.bg_color;
    ad_header.style.backgroundImage = 'url("'+ad_style.bg_img_src+'")';
    var headerBody = document.getElementById('headerBody');
    headerBody.style.height = ad_style.bg_height - 22 + 'px';
    var publisher_logo = document.getElementById('publisherLogo');
    var previewAreaHolder = document.getElementById('previewAreaHolder');
    if (ad_style.use_logo) {
        if (document.getElementById("previewAreaHolder") != null && !(navigator.userAgent.indexOf("MSIE 6.0") > 0)) { //fix browser compatibility when preview publisher logo
            if (!uploadFinish) {
                setTimeout(refreshAd, 1000);
                return;
            }
        }
        publisher_logo.innerHTML = '<img src="'+ad_style.logo_src+'" onload="if(\'function\' == typeof(resizeAdHeader)){resizeAdHeader(this);}" />';
    }
    else {
        publisher_logo.style.fontSize = ad_style.font_size + 'px';
        publisher_logo.style.fontFamily = ad_style.font_type;
        publisher_logo.style.color = ad_style.font_color;
        publisher_logo.style.fontWeight = ad_style.font_bold;
        publisher_logo.style.textDecoration = ad_style.font_underline;
        publisher_logo.style.fontStyle = ad_style.font_italic;
        publisher_logo.innerHTML = ad_style.site_name;
        if (publisher_logo.scrollHeight > parseInt(headerBody.style.height)) {
            ad_header.style.height = publisher_logo.scrollHeight + 22 + 'px';
            ad_header.style.height = publisher_logo.scrollHeight + 22 + 'px'; //this statement is not duplicated but necessary
        }
    }

    document.getElementById('skipButton').style.display = ad_style.show_skip ? 'block' : 'none';
    if ('' == document.getElementById('advertiserName').innerHTML) {
        document.getElementById('advertiserName').innerHTML = htmlSpecialChars(ad_style.advertiser_name);
    }
};

var resizeAdHeader = function(obj) {
    if ((navigator.userAgent.indexOf("MSIE 6.0") > 0))  return;
    if (true == ad_style.use_logo) {
        var win_height = document.getElementById('adHeader').clientHeight;
        var total_height = obj.height + 22;
        document.getElementById('adHeader').style.height = win_height  + 'px';
        if (total_height > win_height) {
            document.getElementById('adHeader').style.height = total_height + 'px';
        }
    }
    if (document.getElementById("previewAreaHolder") != null) {
        resizeAdHeaderWidth();
    }
};

var resizeAdHeaderWidth = function() {
    resetTableStyle();
    var ad_header = document.getElementById('adHeader');
    var publisher_logo = document.getElementById('publisherLogo');
    var previewAreaHolder = document.getElementById('previewAreaHolder');
    if (isIE7()) {
        ad_header.style.width = ad_header.scrollWidth;
    }
    else {
        //resize adHeader div width
        var adHeaderWidth = publisher_logo.clientWidth + document.getElementById('skipButton').clientWidth;
        var adHeaderBorder = parseInt(ad_header.style.border) * 2;
        previewAreaHolder.style.width = ((adHeaderWidth + adHeaderBorder + 20) > 370) ? "100%" : "370px";
    }
    centerTablePosition();
};

var centerTablePosition = function() {
    var controlLayer = document.getElementById('control');
    var tableWidth = document.getElementById("cbAdspaceAdd").clientWidth;
    var defaultTableWidth = (isIE7()) ? 746 : 744;
    if (controlLayer && tableWidth > defaultTableWidth) {
        controlLayer.style.width = tableWidth + 'px';
    }
};

var changeName = function(name) {
    document.getElementById('advertiserName').innerHTML = htmlSpecialChars(name);
};

var changeUrl = function(src) {
    if (document.getElementById('adBody')) {
        if (isUrl(src)) {
            window.frames['ad_body'].location.replace(src);
        }
    }
};

-->
</script>
<script language="javascrip" type="text/javascript">
<!--

var changed = false;
var bgColorIconOnclick = document.getElementById("backgroundColorIcon").onclick;
var fontColorIconOnclick = document.getElementById("fontColorIcon").onclick;

var prepareForPreview = function(uploadAction) {  
    document.getElementById("cbLayout").target = "hidden_frame";    
    document.getElementById("cbLayout").action = "selling-cb-adspace-upload-image.php";   
    document.getElementById("cbLayout").submit();
}



var previewCustomize = function() {
    backgroundColor = document.getElementById('customize_background_color');
    fontColor = document.getElementById("fontColor");
    var reg = /^#[0-9a-fA-F]{6}$/;
    if ('TRANSPARENT' != backgroundColor.value && ! reg.test(backgroundColor.value)) {
        alert(alert_color_incorrect.replace('<field name>', backgroundColor.nextSibling.firstChild.nodeValue));
        focusElement(backgroundColor);
        return;
    }
    if (!reg.test(fontColor.value)) {
        alert(alert_color_incorrect.replace('<field name>', fontColor.nextSibling.firstChild.nodeValue));
        focusElement(fontColor);
        return;
    }
    ad_style.bg_height = document.getElementById('customize_height').value;
    ad_style.bg_color = document.getElementById('customize_background_color').value;
    
    ad_style.font_size = document.getElementById("fontSize").value;
    ad_style.font_color = document.getElementById("fontColor").value;
    ad_style.font_type = document.getElementById("customize_font_type").value;
    ad_style.font_bold = document.getElementById("fontBold").checked ? "bold" : "normal";
    ad_style.font_underline = document.getElementById("fontUnderline").checked ? "underline" : "none";
    ad_style.font_italic = document.getElementById("fontItalic").checked ? "italic" : "normal";
    ad_style.show_skip = document.getElementById("showSkip").checked ? true : false;
    refreshAd();
    changed=true;
};

var resetTableStyle = function() {
    if (document.getElementById('control') != null) {
        document.getElementById('control').style.width = "700px";
    }
    if (!document.all) {
        document.getElementById("previewAreaHolder").style.width = "370px";   
    }
    else if (isIE7()) {
        document.getElementById("adHeader").style.width = "370px";
    }
};

var pageOnload = window.onload;
window.onload = function() {
    if (pageOnload) {
        pageOnload();
    }            
}
var websites_rating = new Array();
    websites_rating['72687'] = 'nsfw';
    websites_rating['72719'] = 'nsfw';
var ratings = {'sfw' : 'Safe For Work', 'nsfw' : 'Not Safe For Work', 'adult' : 'Adult'};
var base_url = '?sid=76f35196c884c2ef8f640a5348795394';
var message = 'Do you want to save your changes?';
var publisher_site_name = 'Publisher Site Name';
var website_name = {
        '0' : 'Please Select',
        '72687' : 'esolzdemos',
        '72719' : 'test',
        '' : ''
};

var showFullSize = function() {
    var win_height = document.getElementById('cb_ad_preview').scrollHeight;
    win_height += 25;
    var win_pop = window.open('about:blank', '_blank', 'height='+win_height+',toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=no');
    win_pop.document.write('<html><head><title>Ad Space Preview</title>');
    win_pop.document.write('<script type="text/javascript">window.onload=function(){if (document.getElementById("adHeader")) document.getElementById("adHeader").style.width = "100%";}');
    win_pop.document.write('</scrip' + 't>');
    win_pop.document.write('<style>body{margin:0px;background-color:#FFFFFF;color:#5E5E5E;font-size:11px;font-family:Tahoma,Arial,Helvetica,San-serif;}.blackbold{color:#000000;font-weight:bold;}');
    win_pop.document.write('a:link,a:visited{text-decoration:none;color:#5E5E5E;font-size:11px;}a:hover{text-decoration:none;color: #10215A;font-size:11px;}</style>');
    win_pop.document.write('</head><body style="margin:0px"><div id="cb_ad_preview">');
    win_pop.document.write(document.getElementById('cb_ad_preview').innerHTML);
    win_pop.document.write('</div>');
    if ('block' == document.getElementById('notice').style.display) {
        win_pop.document.write('<div style="color:red">'+document.getElementById('notice').innerHTML+'</div>');
    }
    win_pop.document.write('<div style="text-align:center;padding-top:5px"><a id="closeLink" href="#" onclick="window.close()" onmouseover="return true;" class="blackbold" title="Close Window">[CLOSE]</a></div>');
    win_pop.document.write('</body></html>');
    win_pop.document.title = "Ad Space Preview";
    win_pop.document.close();
};
-->
</script>	
	<?php
	
}
function step3($data=null)
{
	
 ?>
 <script language="javascript">
function validateStep3()
{
	var validate =true;
	var msg='';
	val =jQuery.trim(jQuery('#bid').val());
	if(val=='')
	{
		validate =false;
		msg+="Please specify a bid for this ad.\n";
	}else if(val < 0.01){
		validate =false;
		msg+="You must set a minimum bid of $0.01 for this ad.\n";
	}
	if(!validate)	//alert error message if not vaild
		alert(msg);			
	return validate;
}
</script>
	<table width="98%" border="0" cellspacing="0" cellpadding="0">
   <tr>
      <td valign="top" align="center">
         <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
               <td width="20%" valign="top"><?php include("left_pannel.php"); ?></td>
               	<td style="width:10px;">&nbsp;</td>
                    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="11"><img src="images/PinkBorderTopLeft.jpg" alt="" width="11" height="11"></td>
                              <td class="PinkBoxTopBg"><img src="images/spacer.gif" alt="" width="10" height="11"></td>
                              <td width="11"><img src="images/PinkBorderTopRight.jpg" alt="" width="11" height="11"></td>
                            </tr>
                        </table></td>
                      </tr>
                      <tr>
                      
                        <td class="PinkTwosideBorder" valign="top">
                        	<table width="100%" class="center" cellspacing="0" cellpadding="0">
  								 <tr>
							    	<td align="left" valign="top">
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
							           	<tr>
							           <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
							               <tr>
											<td width="29"><img src="images/TitleArrowLeft.jpg" alt="" width="29" height="30"></td>
											<td class="MarketTitleBg"><?php echo REGISTER_TXT;?></td>
							                </tr>
							                </table>
									  </td>
							          </tr>
									<tr>
									<TD align="center">
									<br/><br/><br/>
									<?php stepInfo();?>
																			<!--code--->
										<form name="frm_step1" id="Form1" method="POST" action="" >
										
										<table style="background-color: rgb(153, 153, 153); width: 95%;" cellpadding="3" cellspacing="1" align="center" border="0">
											<thead style="font-family:arial;font-size:12px;height:25px;">
												<tr>
													<th style="text-align: left; color: rgb(255, 255, 255); font-weight: bold;" class="blue-background-small">&nbsp;&nbsp;&nbsp;Bid</td>
													<th style="text-align: right; color: rgb(255, 255, 255); font-weight: bold;" class="blue-background-small">Min Bid&nbsp;&nbsp;&nbsp;</td>
												</tr>
											</thead>
											<tbody>
												<tr style="background-color: rgb(251, 251, 251);">
													<td height="30">&nbsp;&nbsp;&nbsp;$<input type="text" size="8" name="bid" value="0.02" id="bid"></td>
													<td height="30" align="right" style="border-left:0px;">$0.01&nbsp;&nbsp;&nbsp;</td>
												</tr>
											</tbody>
										</table>
									</td>
	                              </tr>
	                              <tr>
	                              	<td height="25">&nbsp;</td>
	                              </tr>
	                              <tr>
                                          <td height="25" style="padding-left: 20px;">
	                              		<input name="submit" type="submit" class="SubmitInputButton" id="button3" value="Next" onclick="return validateStep3();">
										&nbsp;
										<input type="submit" name="submit" value="Cancel"/>
	                              	</td>
	                              </tr>
	                            </table>
							</TD>
						</tr>
					</table>
									
									    </td>
									  </tr>
										<tr>
											<td>
												<table width="100%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td width="11"><img src="images/PinkBorderBottomLeft.jpg" alt="" width="11" height="11"></td>
														<td class="PinkBoxBottomBg"><img src="images/spacer.gif" alt="" width="10" height="11"></td>
														<td width="11"><img src="images/PinkBorderBottomRight.jpg" alt="" width="11" height="11"></td>
													</tr>
												</table>
											</td>
										</tr>
										</table></td>
										<td >&nbsp;</td>
										</tr>
									</table></td>
			                      </tr>
			                      
			                </table></td>
			              </tr>
			            </table>
			           
			</form>	
<?php
}

function step4($data=null)
{
	//definded	  
	$CREDIT_TYPES = array(
		'Visa Card'=>'Visa Card',
		'Discover'=>'Discover',
		'MasterCard'=>'MasterCard',
		'American Express'=>'American Express'
		
	);
	$MONTH_TITLES = array(
		'01'=>'01 - January',
		'02'=>'02 - February',
		'03'=>'03 - March',
		'04'=>'04 - April',
		'05'=>'05 - May',
		'06'=>'06 - June',
		'07'=>'07 - July',
		'08'=>'08 - August',
		'09'=>'09 - September',
		'10'=>'10 - October',
		'11'=>'11 - November',
		'12'=>'12 - December',
		);	
	// get user information 
	$query = "SELECT * FROM siteusers WHERE siteuserId='".$_SESSION['siteuserId']."'";
	$result = mysql_query($query);
	$userInfo = mysql_fetch_array($result);
	// get country infomation	
	$query = "SELECT * FROM country WHERE status='Y'";
	$countryRs = mysql_query($query);	
	
	?>
	<link href="css/cc-style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="js/add-credit-card.js"></script>
	
    
<table width="98%" border="0" cellspacing="0" cellpadding="0">
   <tr>
      <td valign="top" align="center">
         <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
               <td width="20%" valign="top"><?php include("left_pannel.php"); ?></td>
               	<td style="width:10px;">&nbsp;</td>
                    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="11"><img src="images/PinkBorderTopLeft.jpg" alt="" width="11" height="11"></td>
                              <td class="PinkBoxTopBg"><img src="images/spacer.gif" alt="" width="10" height="11"></td>
                              <td width="11"><img src="images/PinkBorderTopRight.jpg" alt="" width="11" height="11"></td>
                            </tr>
                        </table></td>
                      </tr>
                      <tr>
                      
                        <td class="PinkTwosideBorder" valign="top">
                        	<table width="100%" class="center" cellspacing="0" cellpadding="0">
  								 <tr>
							    	<td align="left" valign="top">
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
							           	<tr>
							           <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
							               <tr>
											<td width="29"><img src="images/TitleArrowLeft.jpg" alt="" width="29" height="30"></td>
											<td class="MarketTitleBg"><?php echo REGISTER_TXT;?></td>
							                </tr>
							                </table>
									  </td>
							          </tr>
									<tr>
									<TD align="center">
									<br/><br/><br/>
									<?php stepInfo();?>
	
									 <div class="tooltip" id="tooltip">
    </div>
    <div class="general-content-area" style='padding-left:230px'>
        <noscript>
            <div id="javascript_needed">
                <p>
                    <strong>Javascript must be enabled</strong> in order to use this part of Sio.</p>
                <p>
                    It seems JavaScript is either disabled or not supported by your browser, which means
                    <strong>the page below might not work properly.</strong></p>
                <p>
                    We apologize for this inconvenience.</p>
            </div>
        </noscript>
        <div id="Dis_Mes" style="color: #FF0000; font-weight: bold;text-align:left;">
        </div>
        <div id="content-area">
            <div class="page-header">                
            </div>
            <form method="post" action="" name="add-card" onsubmit="return validateCart();">
            <input name="form_submitted" value="1" type="hidden">
            <input id="address" name="address" value="<?php echo $userInfo['field'];?>" type="hidden">
            <input id="city" name="city" value="<?php echo $userInfo['field'];?>" type="hidden">
            <input id="state" name="state" value="<?php echo $userInfo['field'];?>" type="hidden">
            <input id="zip" name="zip" value="<?php echo $userInfo['field'];?>" type="hidden">
            <input id="country" name="country" value="<?php echo $userInfo['field'];?>" type="hidden">
            <input id="last-name" name="last_name" value="<?php echo $userInfo['lName'];?>" type="hidden">
            <input id="first-name" name="first_name" value="<?php echo $userInfo['fName'];?>" type="hidden">
            <input name="ad_cart_id" value="" type="hidden">
            <div class="form-box" style="margin: 0pt;">
                <h3 style="text-align:left">
                    Credit card info</h3>
                <span class="label required">Card type*:</span><span class="form-subbox">
                    <select name="card-type">
                        <?php foreach($CREDIT_TYPES as $val=>$title):?>
                        <option value="<?php echo $val;?>" 
							<?php echo $val==$_POST['card-type']?'selected':'';?>>
							<?php echo $title;?>
                        </option>
                        <?php endforeach;?>
                    </select></span><br>
                <div style="margin: 5px 0px; text-align: right;">
                    <img src="images/credit_cards.gif" alt="credit card" style="border: medium none;
                        padding: 5px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; margin-left: 10px;
                        vertical-align: middle; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial;
                        -moz-background-inline-policy: -moz-initial; margin-right: 30px;" width="160"></div>
                <span class="label required">Credit card number*:</span>
                <input id="card-number" name="card-number" value="<?php echo $_POST['card-number'];?>" type="text"><br>
                <span class="label required">Expiration date*:</span><span class="form-subbox">
                    <select name="card_exp_month" class="expiration-date">
                        <?php foreach($MONTH_TITLES as $val=>$title):?>
                        <option value="<?php echo $val;?>" 
							<?php echo $val==$_POST['card_exp_month']?'selected':'';?>>
							<?php echo $title;?>
                        </option>
                        <?php endforeach;?>
                    </select>
                    <select name="card_exp_year" class="expiration-date">
                        <?php
							$currentYear = date('Y');
							for($i=$currentYear;$i<$currentYear+20;$i++)
							{
								echo "<option value='$i'>$i</option>";
							}
                        ?>
                    </select>
                </span>
                <br>
                <span id="cvn"><span class="label required">CVN*:</span>
                    <input id="cnv" name="cvn" value="<?php echo $_POST['cvn'];?>" type="text">
                    [ <a href="#" onclick="window.open('cvv2_desc.html','cvv2','width=500,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes');return false">
                        what is this?</a> ]</span>
                <h3 style="text-align:left">
                    Billing address</h3>
                <span class="label">&nbsp;</span><input id="use-account-address" name="use-account-address"
                    onclick=" if(document.getElementById('use-account-address').checked)useAccount();"
                    type="checkbox">
                <span class="form-text">Same as "account info"</span>
                <br>
                <span class="label required">Name*:</span>
                <input id="billing-name" name="billing-name" value="<?php echo $_POST['billing-name'];?>" type="text"><br>
                <span class="label required">Address*:</span>
                <input id="billing-address" name="billing-address" value="<?php echo $_POST['billing-address'];?>" type="text"><br>
                <span class="label required">City*:</span>
                <input id="billing-city" name="billing-city" value="<?php echo $_POST['billing-city'];?>" type="text"><br>
                <span class="label required">State*:</span>
                <input id="billing-state" name="billing-state" value="<?php echo $_POST['billing-state'];?>" type="text"><br>
                <span class="label required">Zip or postal code*:</span>
                <input id="billing-zip" name="billing-zip" value="<?php echo $_POST['billing-zip'];?>" type="text"><br>
                <span class="label">&nbsp;</span><small>(Required for US and Canada only)</small><br>
                <span class="label required">Country*:</span><span class="form-subbox">
                    <select id="select" name="billing-country">
                      <?php
						while($country = mysql_fetch_array($countryRs))
						{
							echo "<option value='{$country['countries_iso_code_2']}' ".($_POST['billing-country']==$country['countries_iso_code_2']?'selected':'').">{$country['countryName']}</option>";
						}
                      ?>
                    </select></span></div>
            <div style="clear: both;">
            </div>
            <div style="clear:both"></div>
            <div style="padding-left:200px; text-align:left;" >
                <input value="Next" name='submit' id="next-btn" type="submit">
            </div>
            </form>
        </div>
    </div>

							</td>
                              </tr>
                            </table>

		</TD></tr>
		
		</table>

    </td>
  </tr>
	<tr>
		<td>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td width="11"><img src="images/PinkBorderBottomLeft.jpg" alt="" width="11" height="11"></td>
					<td class="PinkBoxBottomBg"><img src="images/spacer.gif" alt="" width="10" height="11"></td>
					<td width="11"><img src="images/PinkBorderBottomRight.jpg" alt="" width="11" height="11"></td>
				</tr>
			</table>
		</td>
	</tr>
	</table></td>
	<td >&nbsp;</td>
	</tr>
</table></td>
                      </tr>
                      
                </table></td>
              </tr>
            </table>
           
</form>
	<?php
}
function step5($data=null)
{
	global $data;		
//	die('xx');

	// save all data to database 
	if(!is_null($data))
	{
		if($_SESSION['languageId']!="")
		{
			$languageId=$_SESSION['languageId'];
		}
		else
		{
			$languageId='1';
		}
		if(!$data->site_id)
		{	
			//save  new website 
			$query = "INSERT INTO  ".SITEMASTER."(
			siteuserId,
			langId,
			adSiteName,
			adSiteType,
			adSiteUrl,
			adcategoryId,			
			siteDescription,			
			publishDate) 
			VALUES('".$_SESSION['siteuserId']."',
			'".$languageId."',
			'".$data->name."',
			'".$data->type."',
			'".$data->url."',
			'".$data->category."',			
			'".$data->description."',
			0)";
			$result = mysql_query($query);			
			$data->site_id = mysql_insert_id();
		}
		if(!$data->site_id)
		{
			// print out sql Error.
			print_r(mysql_error());			
		}
		else
		{
			// saving ad Space
			$adSpace= $data->adSpace;
			$adBid = $data->adsBid;
			$ad_type = $adSpace->ad_type=='N' ? 'direct':'network';
			$query="insert into adspace_master set 
					adsiteId='".$data->site_id."',
					UserId='".$_SESSION['siteuserId']."',
					langId='".$languageId."',
					adSpaceName='{$adSpace->name}',
					description='{$adSpace->description}',
					ad_Type = '".$ad_type."',
					minPrice ='".$adBid->amount."',
					readyDate='{$adSpace->begin_date}'";
			$result = mysql_query($query);
			$adspaceId = mysql_insert_id();	
			//update MD5 id for ad Space
			$md_no=md5($adspaceId);
			$result=mysql_query("update adspace_master set adspaceIdMd='".$md_no."' where adspaceId='".$adspaceId."' ");
			include_once("watermark_funpast.php");
			//update ad space details			
			switch(strtolower($adSpace->space_type))
			{
				case "text":					
					// allow network
					$allowNetwork = $adSpace->hide_broker_link=='No'?'N':'Y';					
					$query = "insert into adspace_details set 
					adspaceId='".$adspaceId."', 
					adspaceIdMd='".$md_no."',  
					adspaceType='".$adSpace->space_type."',
					adSize='".$adSpace->size."',
					fontType='".$adSpace->font_type."',
					backgroundColor='".$adSpace->background_color."',
					noOfTextAd='".$adSpace->cell_count."',
					headerColor='".$adSpace->headline_color."',
					thumbOrientation='".$adSpace->alignment."',
					bodyColor='".$adSpace->description_color."',
					allowNetwork='".$allowNetwork."' ";
					$result = mysql_query($query);
					if(mysql_errno()>0)
						echo "SQL Error INSERT QUERY adspace_details: ".mysql_error()."<br/>$query";
					break;
				case "banner":				
					################ For file upload coding  starts ##################
					//$data
					//print_r($adSpace->banner);
					if ($adSpace->banner['error'] > 0)
					{
						echo "Error: " . $adSpace->banner['error'] . "<br />";
					}
					else
					{
						$file_name = $adSpace->banner['name'];
						$extension = explode('.',$file_name);
						$adSpace_image = md5($_SESSION[adspaceId].time()) .".".$extension[count($extension)-1];
						$folder_original="upload_adspace_image";
						$folder_thumbnail="upload_adspace_image_thumb";
						$thumb_height='147px';
						$thumb_width='201px';
						$xx=move_uploaded_file($adSpace->banner["tmp_name"],dirname(__FILE__).DS."upload_adspace_image".DS. $adSpace_image);
						
						// create thumbnail
						if($xx)
							watermark_funpast($adSpace_image,$folder_original,$folder_thumbnail,$thumb_height,$thumb_width);					
					}										
					#################### End of file upload ends #################	
					$query= "insert into adspace_details set 
							adspaceId='".$adspaceId."',
							adspaceIdMd='".$md_no."',
							adspaceType='".$adSpace->space_type."',
							adSize='".$adSpace->size."',
							headerFontType='".$adSpace->header_font_type."',
							headerColor='".$adSpace->header_background_color."' ,														
							bodyColor='".$adSpace->body_background_color."',							
							bodyFontType='".$adSpace->body_font_type."'														
							 ";
					$result = mysql_query($query);		
					if(mysql_errno()>0)
						echo "SQL Error INSERT QUERY adspace_details: ".mysql_error();
					$result=mysql_query("update adspace_master set adSpace_image='".$adSpace_image."' where adspaceId='".$adspaceId."' ");			
					if(mysql_errno()>0)
						echo "SQL Error INSERT QUERY adspace_details: ".mysql_error();
					break;
				case "thumbnail":					
					//details
					$query= "insert into adspace_details set 
							adspaceId='".$adspaceId."', 
							adspaceIdMd='".$md_no."',  
							adspaceType='".$adSpace->space_type."',
							thumbCompHandle ='{$adSpace->thumbCompHandle}',
							thumbCompAge ='{$adSpace->thumbCompAge}',
							thumbComplOCATION ='{$adSpace->thumbComplOCATION}',
							thumbCompHeadline ='{$adSpace->thumbCompHeadline}',
							thumbCompImage ='{$adSpace->thumbCompImage}',
							allowNetwork ='{$adSpace->allowNetwork}',
							thumbSize ='{$adSpace->thumbSize}',
							thumbCustomSize ='{$adSpace->thumbCustomSize}',
							thumbCustomWidth ='{$adSpace->thumbCustomWidth}',
							thumbCustomHeight ='{$adSpace->thumbCustomHeight}',
							thumbView ='{$adSpace->thumbView}',
							backgroundColor ='{$adSpace->backgroundColor}',
							thumbOrientation ='{$adSpace->thumbOrientation}'
							";
					$result = mysql_query($query);		
					if(mysql_errno()>0)
						echo "Sql Error adspace_details: ".mysql_error();
					//headers
					$query= "insert into thumb_header set 
							adspaceId='".$adspaceId."', 							
							thHeaderFontSize ='{$adSpace->thHeaderFontSize}',
							thHeaderFontType ='{$adSpace->thHeaderFontType}',
							thHeaderFontColor ='{$adSpace->thHeaderFontColor}',
							thHeaderAttriBold ='{$adSpace->thHeaderAttriBold}',
							thHeaderAttriItalic ='{$adSpace->thHeaderAttriItalic}',
							thHeaderAttriUnderline ='{$adSpace->thHeaderAttriUnderline}',
							thHeaderAlign ='{$adSpace->thHeaderAlign}'
							";
					$result = mysql_query($query);		
					if(mysql_errno()>0)
						echo "Sql Error thumb_header: ".mysql_error();	
					//bodys
					$query= "insert into thumb_body set 
							adspaceId='".$adspaceId."', 							
							thumbBodyFontSize ='{$adSpace->thumbBodyFontSize}',
							thumbBodyFontType ='{$adSpace->thumbBodyFontType}',
							thumbBodyFontColor ='{$adSpace->thumbBodyFontColor}',
							thumbBodyAttriBold ='{$adSpace->thumbBodyAttriBold}',
							thumbBodyAttriItalic ='{$adSpace->thumbBodyAttriItalic}',
							thumbBodyAttriUnderline ='{$adSpace->thumbBodyAttriUnderline}',
							thumbBodyAlign ='{$adSpace->thumbBodyAlign}'
							";
					$result = mysql_query($query);		
					if(mysql_errno()>0)
						echo "Sql Error thumb_body: ".mysql_error();	
					
					break;
					
				case "customize_commbreak":
					//details
					$query= "insert into adspace_details set 
							adspaceId='".$adspaceId."', 
							adspaceIdMd='".$md_no."',  
							adspaceType='".$adSpace->space_type."',
							commercialHeight ='{$adSpace->commercialHeight}',
							backgroundColor ='{$adSpace->backgroundColor}',
							fontSize ='{$adSpace->fontSize}',
							fontType ='{$adSpace->fontType}',
							color ='{$adSpace->color}',
							commercialAttrBold ='{$adSpace->commercialAttrBold}',
							commercialAttrUnderline ='{$adSpace->commercialAttrUnderline}',
							commercialAttrItalic ='{$adSpace->commercialAttrItalic}'
							";							
							$result = mysql_query($query);
							if(mysql_errno()>0)
								echo "SQL Error adSapce_details for commercial".mysql_error().'<br/>Query: '.$query;
					
					break;
			}
			
			$data=null;
			
		}
		
		// generating code
		if($_SESSION['languageId']!="")
		{
			$languageId=$_SESSION['languageId'];
		}
		else
		{
			$languageId='1';
		}
		
	}
	else
	{
		echo "<script>window.location='sell_website_add.php?tab=sell_ads&subMenu=1';</script>";
		return;
	}
	
	?>	
	
  
<table width="98%" border="0" cellspacing="0" cellpadding="0">
   <tr>
      <td valign="top" align="center">
         <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
               <td width="20%" valign="top"><?php include("left_pannel.php"); ?></td>
               	<td style="width:10px;">&nbsp;</td>
                    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="11"><img src="images/PinkBorderTopLeft.jpg" alt="" width="11" height="11"></td>
                              <td class="PinkBoxTopBg"><img src="images/spacer.gif" alt="" width="10" height="11"></td>
                              <td width="11"><img src="images/PinkBorderTopRight.jpg" alt="" width="11" height="11"></td>
                            </tr>
                        </table></td>
                      </tr>
                      <tr>
                      
                        <td class="PinkTwosideBorder" valign="top">
                        	<table width="100%" class="center" cellspacing="0" cellpadding="0">
  								 <tr>
							    	<td align="left" valign="top">
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
							           	<tr>
							           <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
							               <tr>
											<td width="29"><img src="images/TitleArrowLeft.jpg" alt="" width="29" height="30"></td>
											<td class="MarketTitleBg"><?php echo REGISTER_TXT;?></td>
							                </tr>
							                </table>
									  </td>
							          </tr>
									<tr>
									<TD align="center">
									<br/><br/><br/>
									<?php stepInfo();?>
									<?php
	global $activeStep;
	$activeStep=1;
									?>
									<!--code--->
	<form name="frm_step1" id="Form1" method="POST" action="" >
	
	<table style="background-color: rgb(153, 153, 153); width: 95%;" cellpadding="3" cellspacing="1" align="center">
	<tbody><tr>
	<td style="text-align: left; color: rgb(255, 255, 255); font-weight: bold;" class="blue-background-small">Ad Space Code</td>
	</tr>
	<tr style="background-color: rgb(251, 251, 251);">
	
	<td>
	<div style="padding: 3px; text-align: left;">
	<div style="margin: 3px 0px; text-align: left;">
	<div style="float: right;">
	<span id="copy" style="text-align: right; height: 100%; visibility: hidden;">
	<a href="javascript: copyToClipboard(document.getElementById('bannerCode'));"><img src="themes/images/icon-clipboard.gif" alt="Copy To Clipboard">Copy To Clipboard</a>
	</span>
	</div>
	
	
	<div style="clear: both;" align="center">
    <div id="bannerCode" style="border: 1px solid rgb(51, 51, 102); background-color: rgb(204, 204, 204); color: rgb(51, 51, 51); width: 98%; text-align: left;">	
	<?php 
	
	$code='<script language="javascript" type="text/javascript" charset="utf-8">
			ads_val="'.md5($adspaceId).'";
			ad_direc_net= "'.'Y'.'";
			url="'.$GLOBALS['site_url'].'";
			</script>
			<script language="javascript" type="text/javascript" charset="utf-8" src="'.$GLOBALS["site_url"].'/Delivery/js/43569278.js"></script>';
	echo htmlentities($code);
	?>
	</div>
	
	</div>  <div style="text-align: center;">
	<!--<input id="preview" name="preview" value="Preview" class="blank-button-middle" onclick="javascript:window.open('selling-adspace-preview.php?sid=698f061bd71550c6b3e89e269eeebc68&space_id=74627&view='+param_view, '_blank', 'height=500,width=600,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes');" type="button">
	<input id="editButtonId" name="edit_button" value="Edit" style="margin-left: 5px;" class="blank-button-small" onclick="javascript: window.location.href='selling-adspace-details.php?sid=698f061bd71550c6b3e89e269eeebc68&space_id=' + 74627" type="button">-->
	<input id="doneButtonId" name="done_button" value="Done" style="margin-top: 8px; margin-left: 5px;" class="yellow-button-small" onClick="javascript: window.location.href='all_websites.php?tab=sell_ads&subMenu=3'" type="button">
	</div>
	</div>
	</div>
	</td>
	
	</tr>
	</tbody></table>
									

							</td>
                              </tr>
                            </table>

		</TD></tr>
		
		</table>

    </td>
  </tr>
	<tr>
		<td>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td width="11"><img src="images/PinkBorderBottomLeft.jpg" alt="" width="11" height="11"></td>
					<td class="PinkBoxBottomBg"><img src="images/spacer.gif" alt="" width="10" height="11"></td>
					<td width="11"><img src="images/PinkBorderBottomRight.jpg" alt="" width="11" height="11"></td>
				</tr>
			</table>
		</td>
	</tr>
	</table></td>
	<td >&nbsp;</td>
	</tr>
</table></td>
                      </tr>
                      
                </table></td>
              </tr>
            </table>
           
</form>	
	<?php
}
?>
